Possible Duplicate:
Breaking out of a nested loop
How to exit from nested loops at a specific level. For example:
foreach (item in Items)
{
foreach (item2 in Items2)
{
// Break; => we just exit the inner loop
// while we need to break both loops.
}
}
And if there are more nested loops and we want to exit Nth loop from inside. Something like break(2)
at the above example which breaks both loops.