Answers for "how to skip first iteration in while loop c#"

C#
0

c# skip only first element in array

contents.Skip(1)
Posted by: Guest on May-08-2021
0

how to loop through a list and skip first element in c#

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());
}
Posted by: Guest on November-03-2020

Code answers related to "how to skip first iteration in while loop c#"

C# Answers by Framework

Browse Popular Code Answers by Language