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

◆ Encode() [2/5]

virtual string System.Text.Encodings.Web.TextEncoder.Encode ( string value)
inlinevirtualinherited

Definition at line 68 of file TextEncoder.cs.

69 {
70 if (value == null)
71 {
72 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
73 }
74 int num = FindFirstCharacterToEncode(value.AsSpan());
75 if (num < 0)
76 {
77 return value;
78 }
79 return EncodeToNewString(value.AsSpan(), num);
80 }
string EncodeToNewString(ReadOnlySpan< char > value, int indexOfFirstCharToEncode)
unsafe int FindFirstCharacterToEncode(char *text, int textLength)

References System.Text.Encodings.Web.TextEncoder.EncodeToNewString(), System.Text.Encodings.Web.TextEncoder.FindFirstCharacterToEncode(), System.Text.Encodings.Web.ThrowHelper.ThrowArgumentNullException(), and System.Text.Encodings.Web.value.

Referenced by System.Text.Encodings.Web.TextEncoder.Encode(), and System.Text.Json.JsonWriterHelper.EscapeString().