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

◆ AppendFormatted< T >() [4/4]

Definition at line 158 of file DefaultInterpolatedStringHandler.cs.

159 {
161 {
162 AppendCustomFormatter(value, format);
163 return;
164 }
165 string text;
166 if (value is IFormattable)
167 {
168 if (value is ISpanFormattable)
169 {
170 int charsWritten;
171 while (!((ISpanFormattable)(object)value).TryFormat(_chars.Slice(_pos), out charsWritten, format, _provider))
172 {
173 Grow();
174 }
175 _pos += charsWritten;
176 return;
177 }
178 text = ((IFormattable)(object)value).ToString(format, _provider);
179 }
180 else
181 {
182 text = value?.ToString();
183 }
184 if (text != null)
185 {
187 }
188 }
Span< T > Slice(int start)
Definition Span.cs:271

References System.Runtime.CompilerServices.DefaultInterpolatedStringHandler._chars, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler._hasCustomFormatter, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler._pos, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler._provider, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendStringDirect(), System.format, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.Grow(), System.Span< T >.Slice(), System.text, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.ToString(), and System.value.