111,129
社区成员
发帖
与我相关
我的任务
分享
int Index=-1;
foreach (var item in arr.Select((n, index) => new { n, index })) // n 数组值,index 索引值
{
Console.WriteLine(item.n);
Console.WriteLine(item.index);
Index = item.index;
}
int i=-1;
while(++i<arr.Length)
{
string alist = arr[i];
//...
}