I was writing some ASP.NET control when I came to the scenario where I needed to remove items from a list, only when they matched a certain condition.
The RemoveAll method of the generic List class does a good job, but removes all items that match the condition, specified by the predicate. What if I want to only remove a certain number of items specifying the condition? What do you think is the best way to do this?