Breaking out of a nested loop

Posted by dotnetdev on Stack Overflow See other posts from Stack Overflow or by dotnetdev
Published on 2008-11-27T23:58:44Z Indexed on 2010/04/04 13:53 UTC
Read the original article Hit count: 225

Filed under:
|
|

If I have a for loop which is nested within another, how can I efficiently come out of both loops (inner and outer) in the quickest possible way?

I don't want to have to use a boolean and then have to say go to another method, but rather just to execute the first line of code after the outer loop.

What is a quick and nice way of going about this?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about nested-loops