title: Exit from nested loops at desired level
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/324831/breaking-out-of-a-nested-loop">Breaking out of a nested loop</a>  </p>
  </blockquote>
  
  
  
  <p>How to exit from nested loops at a specific level. For example:</p>
  
  <pre><code>foreach (item in Items)
  {
      foreach (item2 in Items2)
      {
          // Break; =&gt; we just exit the inner loop
          //           while we need to break both loops.
      }
  }
  </code></pre>
  
  <p>And if there are more nested loops and we want to exit Nth loop from inside. Something like <code>break(2)</code> at the above example which breaks both loops.</p>