title: How do i exit a List<string>.ForEach loop when using an anonymous delegate?
body: <p>In a normal loop you can break out of a loop using break.  Can the same be done using an anonymous delegate?</p>
  
  <p>Example
  inputString and result are both declared outside the delegate.</p>
  
  <pre><code>blackList.ForEach(new Action&lt;string&gt;(
      delegate(string item)
      {
          if(inputString.Contains(item)==true)
          {
              result = true;
              // I want to break here
          }
      }
  ));
  </code></pre>
  
  <p>Edit:
  Thanks for the replies,  I'm actually reading your book at the minute John :) Just for the record i hit this issue and switched back to a normal foreach loop but I posted this question to see if i missed something.</p>