i has IList<Animals> farmAnimals;
this list has three types,
how can I remove all chickens from the list using lambda query or linq-to-objects, so I have a separate list of chickens, and in the original list now there are only a cow and sheep.
Do I need to make three lists (original + 2 new, filtered) and then delete the original list? or is there a more complicated way?
the result should be
IList<Aniamls> chickens;
IList<Animals> farmAnimals;
Hurrah!
QUESTION OF COMPLETION:
which is more effective? FindAll and RemoveAll vs. Where?
source
share