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

◆ MatchAbbreviatedDayName()

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

Definition at line 2924 of file DateTimeParse.cs.

2925 {
2926 int num = 0;
2927 result = -1;
2928 if (str.GetNext())
2929 {
2930 for (DayOfWeek dayOfWeek = DayOfWeek.Sunday; dayOfWeek <= DayOfWeek.Saturday; dayOfWeek++)
2931 {
2932 string abbreviatedDayName = dtfi.GetAbbreviatedDayName(dayOfWeek);
2933 int matchLength = abbreviatedDayName.Length;
2934 if ((dtfi.HasSpacesInDayNames ? str.MatchSpecifiedWords(abbreviatedDayName, checkWordBoundary: false, ref matchLength) : str.MatchSpecifiedWord(abbreviatedDayName)) && matchLength > num)
2935 {
2936 num = matchLength;
2937 result = (int)dayOfWeek;
2938 }
2939 }
2940 }
2941 if (result >= 0)
2942 {
2943 str.Index += num - 1;
2944 return true;
2945 }
2946 return false;
2947 }

References System.str.

Referenced by System.DateTimeParse.ParseByFormat().