摘要:
一、初始化数组:string[] s1 = {“aaa”,”bbb”,”ccc”} //直接赋值string[] s2 = new string[3] {“aaa”,”bbb”,”ccc”}; //赋值加指定长度string[] s3 = new string[]{“aaa”,”bbb”,”ccc”}; string[] s4 = new string[5]; //用循环直接赋值二、遍历数组:foreach (string s in str){ Console.Write(s);}三、二维数组:string[,] arr2; //声明一个二维数组string[,,] arr3; ... 阅读全文