G
Guest
Here's some pseudo-code that describes what I'm trying to do:
foreach(object in collection)
{
if (certain-condition)
collection.Remove(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?
foreach(object in collection)
{
if (certain-condition)
collection.Remove(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?