摘要:
(一)params---------可以让参数随意变化的关键字 1 staticvoid Main(string[] args) 2 { 3 TestParams(1, 2, 3); 4 TestParams(1, 2, 3, 4, 5, 6);//注意参数随意变换 5 6 TestParams2(1, "a", "b", 12, 52, 16); 7 8 Console.ReadLine(); 9 }10 11 staticvoid TestParams(paramsint[] list)12 {13 string str =string.Empty; 阅读全文
摘要:
static void Main(string[] args) { TestString(); TestStringBuilder(); } public static void TestString() { DateTime startTime = DateTime.Now; string str = string.Empty; for (int i = 0; i < 10000; i++)// 一万次 { str += "a"; } DateTime endTime = DateTime.Now; TimeSpan timeSpan = endTime - sta 阅读全文