Possible Duplicate:
How to modify or delete items from an enumerable collection while iterating through it in C#
Listen, I do not want to know about the basic foreach. I am talking about that one which control this error:
"The enumerator is not valid because the collection changed."
Which occur when I do this:
foreach(Image image in images)
{
if(...)
{
images.remove(image)
}
}
I believe there is an special iterator which handle this well, as Java has. So, how can I do this in C# please? Thank you!