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
![[pipe] [pipe] [pipe]](/data/assets/smilies/pipe.gif)
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
![[pipe] [pipe] [pipe]](/data/assets/smilies/pipe.gif)