Skip to content

Add fundamentals coverage for labeled break and continue in C# 15 - #56547

Open
SkyDevLab wants to merge 3 commits into
dotnet:mainfrom
SkyDevLab:docs/54655-labeled-break-continue
Open

SkyDevLab wants to merge 3 commits into
dotnet:mainfrom
SkyDevLab:docs/54655-labeled-break-continue

Conversation

@SkyDevLab

@SkyDevLab SkyDevLab commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds fundamentals coverage for C# 15 (.NET 11) labeled 'break' and 'continue' in the iteration statements guide.

Fixes #54655


Internal previews

File Preview link
docs/csharp/fundamentals/statements/iteration.md Learn preview

Build report

@SkyDevLab
SkyDevLab requested a review from BillWagner as a code owner October 24, 2026 19:45
@dotnetrepoman dotnetrepoman Bot added this to the October 2026 milestone Oct 24, 2026
@dotnet-policy-service dotnet-policy-service Bot added dotnet-csharp/svc fundamentals/subsvc community-contribution Indicates PR is created by someone from the .NET community. labels Oct 24, 2026

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @SkyDevLab

Once you move the new example to a separate cpde snippet, this is ready to merge.

- A labeled `break` (such as `break outer;`) terminates the labeled enclosing loop or `switch` statement immediately.
- A labeled `continue` (such as `continue outer;`) skips the rest of the inner execution and begins the next iteration of the labeled enclosing loop.

```csharp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a large enough sample that it should be referenced as a compiled snippet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied: merged latest main, moved the sample into the compiling project snippet docs/csharp/fundamentals/statements/snippets/iteration-statements/Program.cs under the region, and referenced it via :::code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-csharp/svc fundamentals/subsvc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C# 15-Fundamentals and reference]: Fundamentals for labeled break and continue

2 participants