"csharpula csharp" <cs*******@yahoo.comwrote in message
news:u1**************@TK2MSFTNGP04.phx.gbl...
I am iterating through objects and have the following case:
foreach (classA objectA in classAList)
{
if (classA.count0)
{
//now I need to get out of the foreach loop if so,otherwise to keep
iterating
}
}
What is the best way to do it?
You've been given the answer, but just for completion, the opposite (so to
speak) of "break" is "continue." It's used far less and some would probably
argue that if you structure your code right you'll never need to use it.