Possible Duplicate:
Breaking out of a nested loop
I have this code
foreach (___)
{
foreach (___)
{
foreach (___)
{
if (condition)
{
//break out of all loops
}
}
}
}
But break
only "breaks" the most inner loop (sorry for my english) and I want to leave them all...
I was thinking about :
- GOTO, but I've always been told to not use it
- A sort of boolean-flag
Is there any more elegant way ? like provided by C# ?
Thanks in advance for any help !