Method ExtString.Escape
Overload
Replaces unsafe characters with C# escape sequences. If the string contains these characters, replaces and returns new string. Else returns this string.
public static string Escape(this string t, int limit = 0, bool quote = false)
Parameters
t (string)
This string. |
limit (int)
If the final string is longer than limit, get its substring 0 to limit-1 with appended |
quote (bool)
Enclose in |
Returns
Remarks
Replaces these characters: '\\'
, '"'
, '\t'
, '\n'
, '\r'
and all in range 0-31.