就是循环遍历一个数组,比如:
int[] a = new int[100];
for(int i=0;i
}
foreach(int item in a){
Console.WriteLine(item);
}
参考微软官方文档:http://technet.microsoft.com/zh-cn/magazine/ttw7t8t6.aspx
foreach(Type t in arrys)
{
//..do your things
}
Type:需要遍历每一个的对象的类型
t:每一个对象
arrays:需要遍历的对象数组