generic List<>
Peter Osucha <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <[email protected]> |
I have a generic List<myObject> collection 'myObjects'. MyObject instances
have a bool property 'CanBeRemoved'.
But apparently, it is invalid to
foreach (MyObject mo in myObjects)
{
if (mo.CanBeRemoved==true) myObjects.Remove(mo);
}
Is there a way to remove items from such collection while looping through
the collection?
Peter
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com