Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

continue (C# Reference)

The continue statement passes control to the next iteration of the enclosing iteration statement in which it appears.

In this example, a counter is initialized to count from 1 to 10. By using the continue statement in conjunction with the expression (i < 9), the statements between continue and the end of the for body are skipped.

// statements_continue.cs
using System;
class ContinueTest 
    static void Main() 
        for (int i = 1; i <= 10; i++) 
            if (i < 9) 



For more information, see the following sections in the C# Language Specification:

  • Break, continue, and goto statements

  • 8.9.2 The continue statement

© 2015 Microsoft