foreach (var item in listOfItems) {
if (condition_is_met)
// Any processing you may need to complete here...
break; // return true; also works if you're looking to
// completely exit this function.
}
Should do the trick. The break statement will just end the execution of the loop, while the return statement will obviously terminate the entire function. Judging from your question you may want to use the return true; statement.