字符串拼接

 1 public class StringConcat : MonoBehaviour {
 2 
 3     void Start() {
 4         //(1)性能较低,限制使用
 5         string str1 = "A" + "B" + "C";
 6 
 7         //(2)性能较高, 较多的公司使用这种方式,较简单
 8         string str2 = string.Format("{0}{1}{2}", "A", "B", "C");
 9 
10         //(3)部分公司使用
11         StringBuilder str3 = new StringBuilder();
12         str3.Append("A");
13         str3.Append("B");
14         str3.Append("C");
15     }
16 }
原文地址:https://www.cnblogs.com/AaronBlogs/p/6823443.html