Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ MatchAbbreviatedMonthName()

static bool System.DateTimeParse.MatchAbbreviatedMonthName ( ref __DTString str,
DateTimeFormatInfo dtfi,
ref int result )
inlinestaticprivate

Definition at line 2840 of file DateTimeParse.cs.

2841 {
2842 int maxMatchStrLen = 0;
2843 result = -1;
2844 if (str.GetNext())
2845 {
2846 int num = ((dtfi.GetMonthName(13).Length == 0) ? 12 : 13);
2847 for (int i = 1; i <= num; i++)
2848 {
2849 string abbreviatedMonthName = dtfi.GetAbbreviatedMonthName(i);
2850 int matchLength = abbreviatedMonthName.Length;
2851 if ((dtfi.HasSpacesInMonthNames ? str.MatchSpecifiedWords(abbreviatedMonthName, checkWordBoundary: false, ref matchLength) : str.MatchSpecifiedWord(abbreviatedMonthName)) && matchLength > maxMatchStrLen)
2852 {
2853 maxMatchStrLen = matchLength;
2854 result = i;
2855 }
2856 }
2857 if ((dtfi.FormatFlags & DateTimeFormatFlags.UseGenitiveMonth) != 0)
2858 {
2859 int num2 = str.MatchLongestWords(dtfi.AbbreviatedMonthGenitiveNames, ref maxMatchStrLen);
2860 if (num2 >= 0)
2861 {
2862 result = num2 + 1;
2863 }
2864 }
2865 if ((dtfi.FormatFlags & DateTimeFormatFlags.UseLeapYearMonth) != 0)
2866 {
2867 int num3 = str.MatchLongestWords(dtfi.InternalGetLeapYearMonthNames(), ref maxMatchStrLen);
2868 if (num3 >= 0)
2869 {
2870 result = num3 + 1;
2871 }
2872 }
2873 }
2874 if (result > 0)
2875 {
2876 str.Index += maxMatchStrLen - 1;
2877 return true;
2878 }
2879 return false;
2880 }

References System.str.

Referenced by System.DateTimeParse.ParseByFormat().