摘要: 一、初始化数组: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; ... 阅读全文
posted @ 2014-01-06 10:52 屋大明 阅读(991) 评论(0) 推荐(0) 编辑