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

◆ TryParseQuoteString()

static bool System.DateTimeParse.TryParseQuoteString ( ReadOnlySpan< char > format,
int pos,
StringBuilder result,
out int returnValue )
inlinestaticpackage

Definition at line 3634 of file DateTimeParse.cs.

3635 {
3636 returnValue = 0;
3637 int length = format.Length;
3638 int num = pos;
3639 char c = format[pos++];
3640 bool flag = false;
3641 while (pos < length)
3642 {
3643 char c2 = format[pos++];
3644 if (c2 == c)
3645 {
3646 flag = true;
3647 break;
3648 }
3649 if (c2 == '\\')
3650 {
3651 if (pos >= length)
3652 {
3653 return false;
3654 }
3655 result.Append(format[pos++]);
3656 }
3657 else
3658 {
3659 result.Append(c2);
3660 }
3661 }
3662 if (!flag)
3663 {
3664 return false;
3665 }
3666 returnValue = pos - num;
3667 return true;
3668 }
StringBuilder Append(char value, int repeatCount)

References System.Text.StringBuilder.Append(), System.format, and System.length.

Referenced by System.DateTimeParse.ParseByFormat(), and System.Globalization.TimeSpanParse.TryParseByFormat().