In c#, when I want to remove some items from a list, i do it in the following way,
List<Item> itemsToBeRemoved = new List<Item>();
foreach(Item item in myList)
{
if (IsMatching(item)) itemsToBeRemoved.Add(item);
}
foreach(Item item in itemsToBeRemoved)
{
myList.Remove(item);
}
Is there any better way to do it?