How do I break out of a foreach loop in C# if one of the elements meets the requirement?
foreach
For example:
foreach(string s in sList){
Use the 'break' statement. I find it humorous that the answer to your question is literally in your question! By the way, a simple Google search could have given you the answer.