Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
C#

break and continue in C#

Exit loops with break; skip iterations with continue.

break and continue in C# — a practical guide to C# break continue with clear examples you can reuse in real projects.

C# Tutorial Series (36/121). Prefer one article? Read the complete C# tutorial.

Short description

Use sparingly for readability.

break/continue

foreach (var n in nums)
{
    if (n < 0) continue;
    if (n == 0) break;
    Console.WriteLine(n);
}

Leave a reply

Your email address will not be published. Required fields are marked *