LANGUAGE
break statement
In C# 14, exits the nearest enclosing iteration or switch statement.
Formal Syntax & Structure
csharp syntaxcsharp
break;Working Example
Example Snippetcsharp
for (int i = 0; i < 3; i++) { if (i == 1) break; }In C# 14, exits the nearest enclosing iteration or switch statement.
break;for (int i = 0; i < 3; i++) { if (i == 1) break; }