Skip to content

continue

continue skips the rest of the current iteration and moves to the next.

for (int i = 1; i <= 5; i++)
{
if (i == 3) continue;
Console.WriteLine(i);
}
Terminal window
dotnet run
Terminal window
1
2
4
5