public static string ToEscapedJavaScriptString(string value, char delimiter, bool appendDelimiters) { int?length = StringUtils.GetLength(value); using (StringWriter stringWriter = StringUtils.CreateStringWriter((!length.HasValue) ? 16 : length.Value)) { WriteEscapedJavaScriptString(stringWriter, value, delimiter, appendDelimiters); return(stringWriter.ToString()); IL_003c: string result; return(result); } }
public static string ToEscapedJavaScriptString(string value, char delimiter, bool appendDelimiters, StringEscapeHandling stringEscapeHandling) { string str; bool[] charEscapeFlags = JavaScriptUtils.GetCharEscapeFlags(stringEscapeHandling, delimiter); int? length = StringUtils.GetLength(value); using (StringWriter stringWriter = StringUtils.CreateStringWriter((length.HasValue ? length.GetValueOrDefault() : 16))) { char[] chrArray = null; JavaScriptUtils.WriteEscapedJavaScriptString(stringWriter, value, delimiter, appendDelimiters, charEscapeFlags, stringEscapeHandling, null, ref chrArray); str = stringWriter.ToString(); } return(str); }