public static string Format (string str) { if (String.IsNullOrEmpty (str)) return string.Empty; StringBuilder sb = new StringBuilder (str.Length); MarkupUtilities.AppendEscapedString (sb, str); return sb.ToString (); }
public static string Format(string str) { if (String.IsNullOrEmpty(str)) { return(string.Empty); } var sb = StringBuilderCache.Allocate(); MarkupUtilities.AppendEscapedString(sb, str, 0, str.Length); return(StringBuilderCache.ReturnAndFree(sb)); }