C# .NET: 2 Lists of Same Object Type, Remove Like Objects

12/19/2012 12:25:04 AM

In .NET, you have 2 lists of the same type, remove items from list1 that are also in list2.

//remove list2 items from list1
list1.RemoveAll(x => list2.Contains(x));