How to Skip Iteration of a foreach loop in C# ?

When using C# programming language , there are times when you might want to skip over the iteration based on some condition and jump over to the next iteration.

How to Skip Iteration of a foreach loop in C# ?

continue keyword comes to your rescue for this use case. When you want to skip the processing of current iteration and jump to the next iteration, use the continue keyword as shown below.

foreach (int item in Items)   
{                              
    if (item < 0)             
    {                           
        continue;   // Skip the Iterations
    }
}
%d