Search code examples
c#for-loopskip

How to skip several iterations of a for loop


Is there a clean way to skip several iterations from a from a for loop?

Something like:

for (int i = 0; i< count; i++)
{
   if (condition)
   {
       // skip several iterations of "i"
       continue(5);
   }
}

Solution

  • You can use the following

    i+= 5;
    continue;