class Program { static void Main(string[] args) { // StringBuilder 解决了字符串拼接产生大量的字符串临时对象 string s1 = "abc"; string s2 = "asd"; string s3 = "fghg"; StringBuilder sb = new StringBuilder(); sb.Append(s1); sb.Append(s2); sb.Append(s3); string s4 = sb.ToString(); Console.WriteLine(s4); Console.ReadKey(); //可空类型 int? n1 = null; int? n2 = null; int n3 = (int)n2; }
时间: 2024-11-07 07:49:55