Does anyone know if it is possible to exit a generic ForEach that uses lambda? e.g.
someList.ForEach(sl =>
{
if (sl.ToString() == "foo")
break;
// continue processing sl here
// some processing code
}
);
This code itself won't compile. I know I could use a regular foreach but for consistency I want to use lambda.
Many thanks.