dragonwell
Programmer
I found out that this won't work:
I need to iterate over an ArrayList and remove an object if it meets a criteria but I get "Collection was modified; enumeration operation may not execute."
What is the alternate code?
Thanks,
David
Code:
foreach(MyType myType in myTypeCollection){
myTypeCollection.Remove(myType)
}
I need to iterate over an ArrayList and remove an object if it meets a criteria but I get "Collection was modified; enumeration operation may not execute."
What is the alternate code?
Thanks,
David