Lets say we have two lists:
List<string> listA = new List<string>{"a", "c"};
List<string> listB = new List<string>{"a", "a", "b", "c", "d"};
And we want to remove from listB all duplicates with listA.
listA should be left untouched
listB should be left with elements {"b", "d"}
An obvious solution would be to iterate with loops, but I'm wondering how this can be done with System.Linq one-liner?
Maybe something like...
listB.RemoveAll(x => x.Equals(??));
Or...
listA.ForEach(key => listB.RemoveAll(x => x.Equals(key))); // cannot convert string[] to void