public static void ClearForCurrentThread() { cache = null; _buffer = null; charArrayReader = null; clrStringReader = null; reseekablestringBuilderReader = null; stringBuilderReader = null; valueStringReader = null; }
public static string SubstringCached(this string str, int startIndex, int length) { var reader = clrStringReader ?? (clrStringReader = new ClrStringReader()); reader.ClrString = str; string result = reader.SubstringCached(startIndex, length); reader.ClrString = null; return(result); }