public static void ClearForCurrentThread() { cache = null; _buffer = null; charArrayReader = null; clrStringReader = null; reseekablestringBuilderReader = null; stringBuilderReader = null; valueStringReader = null; }
public static string SubstringCached(this StringBuilder str, int startIndex, int length) { #if SALTARELLE string text = str.ToString(); if (startIndex != 0 || length != text.Length) { return(text.Substr(startIndex, length)); } return(text); #else var reader = stringBuilderReader ?? (stringBuilderReader = new StringBuilderReader()); reader.StringBuilder = str; string result = reader.SubstringCached(startIndex, length); reader.StringBuilder = null; return(result); #endif }
public static string SubstringCached(this StringBuilder str, int startIndex, int length) { #if SALTARELLE string text = str.ToString(); if (startIndex != 0 || length != text.Length) { return text.Substr(startIndex, length); } return text; #else var reader = stringBuilderReader ?? (stringBuilderReader = new StringBuilderReader()); reader.StringBuilder = str; string result = reader.SubstringCached(startIndex, length); reader.StringBuilder = null; return result; #endif }