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

◆ Escape()

static ? string System.Security.SecurityElement.Escape ( string? str)
inlinestatic

Definition at line 338 of file SecurityElement.cs.

339 {
340 if (str == null)
341 {
342 return null;
343 }
344 StringBuilder stringBuilder = null;
345 int length = str.Length;
346 int num = 0;
347 while (true)
348 {
349 int num2 = str.IndexOfAny(s_escapeChars, num);
350 if (num2 == -1)
351 {
352 break;
353 }
354 if (stringBuilder == null)
355 {
356 stringBuilder = new StringBuilder();
357 }
358 stringBuilder.Append(str, num, num2 - num);
359 stringBuilder.Append(GetEscapeSequence(str[num2]));
360 num = num2 + 1;
361 }
362 if (stringBuilder == null)
363 {
364 return str;
365 }
366 stringBuilder.Append(str, num, length - num);
367 return stringBuilder.ToString();
368 }
static string GetEscapeSequence(char c)
static readonly char[] s_escapeChars
override string ToString()
StringBuilder Append(char value, int repeatCount)

References System.Text.StringBuilder.Append(), System.Security.SecurityElement.GetEscapeSequence(), System.length, System.Text.StringBuilder.Length, System.Security.SecurityElement.s_escapeChars, System.str, and System.Text.StringBuilder.ToString().