📜  如何遍历列表并跳过c#代码示例中的第一个元素

📅  最后修改于: 2022-03-11 14:49:01.654000             🧑  作者: Mango

代码示例2
foreach(var item in list.Skip(1))
{
    System.Diagnostics.Debug.WriteLine(item.ToString());
}
//If you want to skip any other element at index n, you could write this:

foreach(var item in list.Where((a,b) => b != n))
{
    System.Diagnostics.Debug.WriteLine(item.ToString());
}