Essential C# Keywords  Suggest an edit

continue

Immediately pass control to the next iteration of the enclosing loop construct (for, foreach, do, while):

for (var i = 0; i < 10; i++)
{
    if (i < 5)
    {
        continue;
    }
    Console.WriteLine(i);
}

Output:

5 6 7 8 9

Live Demo on .NET Fiddle

var stuff = new [] {"a", "b", null, "c", "d"};

foreach (var s in stuff)
{
    if (s == null)
    {
        continue;
    }           
    Console.WriteLine(s);
}

Output:

a b c d

Live Demo on .NET Fiddle


Table Of Contents
22 Enum
25 GUID
52 Keywords
107 Stream
108 Timers
  ↑ ↓ to navigate     ↵ to select     Esc to close