Example #1
0
        public static string Format(string format, params object[] args)
        {
            var sb = MStringBuilderCache.Acquire();

            sb.AppendFormat(format, args);
            return(MStringBuilderCache.GetStringAndRelease(sb));
        }
Example #2
0
        public static string AppendWithSeparator(string separator, object part1, object part2, object part3)
        {
            var sb = MStringBuilderCache.Acquire();

            sb.Append(part1).Append(separator).Append(part2).Append(separator).Append(part3);
            return(MStringBuilderCache.GetStringAndRelease(sb));
        }
Example #3
0
        public static string Append(object part1, object part2)
        {
            var sb = MStringBuilderCache.Acquire();

            sb.Append(part1).Append(part2);
            return(MStringBuilderCache.GetStringAndRelease(sb));
        }
Example #4
0
        public static string Append(params object[] parts)
        {
            var sb = MStringBuilderCache.Acquire();

            for (int i = 0, n = parts.Length; i < n; ++i)
            {
                sb.Append(parts[i]);
            }
            return(MStringBuilderCache.GetStringAndRelease(sb));
        }
Example #5
0
        public static string AppendWithSeparator(string separator, params object[] parts)
        {
            var sb = MStringBuilderCache.Acquire();

            for (int i = 0, endI = parts.Length - 1; i <= endI; ++i)
            {
                sb.Append(parts[i]);
                if (i < endI)
                {
                    sb.Append(separator);
                }
            }
            return(MStringBuilderCache.GetStringAndRelease(sb));
        }