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

◆ MatchEraName()

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

Definition at line 2974 of file DateTimeParse.cs.

2975 {
2976 if (str.GetNext())
2977 {
2978 int[] eras = dtfi.Calendar.Eras;
2979 if (eras != null)
2980 {
2981 for (int i = 0; i < eras.Length; i++)
2982 {
2983 string eraName = dtfi.GetEraName(eras[i]);
2984 if (str.MatchSpecifiedWord(eraName))
2985 {
2986 str.Index += eraName.Length - 1;
2987 result = eras[i];
2988 return true;
2989 }
2990 eraName = dtfi.GetAbbreviatedEraName(eras[i]);
2991 if (str.MatchSpecifiedWord(eraName))
2992 {
2993 str.Index += eraName.Length - 1;
2994 result = eras[i];
2995 return true;
2996 }
2997 }
2998 }
2999 }
3000 return false;
3001 }

References System.Globalization.DateTimeFormatInfo.Calendar, System.Globalization.Calendar.Eras, and System.str.

Referenced by System.DateTimeParse.ParseByFormat().