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

◆ ParseQuoteString()

static int System.DateTimeFormat.ParseQuoteString ( ReadOnlySpan< char > format,
int pos,
StringBuilder result )
inlinestaticpackage

Definition at line 107 of file DateTimeFormat.cs.

108 {
109 int length = format.Length;
110 int num = pos;
111 char c = format[pos++];
112 bool flag = false;
113 while (pos < length)
114 {
115 char c2 = format[pos++];
116 if (c2 == c)
117 {
118 flag = true;
119 break;
120 }
121 if (c2 == '\\')
122 {
123 if (pos >= length)
124 {
125 throw new FormatException(SR.Format_InvalidString);
126 }
127 result.Append(format[pos++]);
128 }
129 else
130 {
131 result.Append(c2);
132 }
133 }
134 if (!flag)
135 {
136 throw new FormatException(SR.Format(SR.Format_BadQuote, c));
137 }
138 return pos - num;
139 }
StringBuilder Append(char value, int repeatCount)

References System.Text.StringBuilder.Append(), System.SR.Format(), System.format, System.SR.Format_BadQuote, System.SR.Format_InvalidString, and System.length.

Referenced by System.DateTimeFormat.FormatCustomized(), and System.Globalization.TimeSpanFormat.FormatCustomized().