List<string> a = new List<string>() { "a", "b", "c" };
List<string> b = new List<string>() { "a", "b", "c", "d", "e", "f" };
b.RemoveAll(a.Contains);
If you loop through b it will now only contain d e and f. Can anyone expand out whats actually happening, because currently it doesnt make any sense at all.
Edit: I was more talking about the use of predicates. How does know how to pass what into where?
no lambda expression required.
perhaps you’d like for the line to read
however, the function
x=> a.Contains(x)is simply a function that takes a string and returns a bool indicating whether a contains x. a.Contains is already a function that does that.