I know this might be a "gotcha", but within the context of a switch statement inside of a loop, to a human, it can be confusing what "break" is referring to.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@ryanwebjackson You are correct.
Is there more information that you need for this than what is available in the 2nd sample? That break breaks out of the inner loop, but not the outer loop.
I was referring to a _switch_ statement inside of a loop, so an example of that would be perfect. Two loops can make it easier to tell what's going on, because you need curly brackets for both (if they're more than one line of code). I don't have access to the code I was looking at when I opened this, but because there can be both breaks (switch and loop) in the same code block -- that syntax can be confusing.
The right fix is to make the following changes:
switch example before the nested loop example.@BillWagner When adding a new snippet to the dotnet/samples repository, should this issue be referenced in commit message, then a PR submitted to samples, _then_ a PR submitted to dotnet/docs repository for this issue?
Either in the commit message or in the PR description is enough. You can then create the docs PR right after, just call out that is dependent on the samples PR you created and we'll make sure to review after the samples PR is merged.
Most helpful comment
Either in the commit message or in the PR description is enough. You can then create the docs PR right after, just call out that is dependent on the samples PR you created and we'll make sure to review after the samples PR is merged.