示例#1
0
    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 ();
    }
示例#2
0
        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));
        }