using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
public class CSStringBuilder
{
public static CSStringBuilder CS { get; set; } = new CSStringBuilder();
public StringBuilder sb = new StringBuilder(1000);
public static void Append(string s1,string s2)
{
StringBuilder msb = CS.sb;
msb.Append(s1);
msb.Append(s2);
}
public static void Append(string s1, string s2, string s3)
{
StringBuilder msb = CS.sb;
msb.Append(s1);
msb.Append(s2);
msb.Append(s3);
}
public static void Append(params string[] strs)
{
if (strs.Length > 0)
{
StringBuilder msb = CS.sb;
int count = strs.Length;
for (int i = 0; i < count; i++)
{
msb.Append(strs[i]);
}
}
}
public static void Clear()
{
CS.sb.Length = 0;
}
public static new string ToString()
{
return CS.sb.ToString();
}
}
字符串拼接优化
最新推荐文章于 2022-09-12 16:17:54 发布