I am converting some Java code to C# and have found a few labelled \"break\" statements (e.g.)
label1:
while (somethingA) {
...
while (som
You can just use goto to jump directly to a label.
while (somethingA)
{
// ...
while (somethingB)
{
if (condition)
{
goto label1;
}
}
}
label1:
// ...
In C-like languages, goto
often ends up cleaner for breaking nested loops, as opposed to keeping track of boolean variables and repeatedly checking them at the end of each loop.