In a normal loop, you can break out of a loop using break. Can the same be done using an anonymous delegate?
Example inputString and result are both declared outside the delegate.
blackList.ForEach(new Action<string>(
delegate(string item)
{
if(inputString.Contains(item)==true)
{
result = true;
// I want to break here
}
}
));
Edit: 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.