Here's some pseudo-code that describes what I'm trying to do:
foreach(object in collection)
{
if (certain-condition)
collection.Remo ve(object);
}
The problem with this is that foreach gets messed up if anything is deleted
from the collection. What's the best way to handle such a situation?
--
Robert W.
Vancouver, BC
foreach(object in collection)
{
if (certain-condition)
collection.Remo ve(object);
}
The problem with this is that foreach gets messed up if anything is deleted
from the collection. What's the best way to handle such a situation?
--
Robert W.
Vancouver, BC
Comment