LINQ query to find if items in a list are contained in another list
- by cjohns
I have the following code:
List<string> test1 = new List<string> { "@bob.com", "@tom.com" };
List<string> test2 = new List<string> { "joe@bob.com", "test@sam.com" };
I need to remove anyone in test2 that has @bob.com or @tom.com.
What I have tried is this:
bool bContained1 =…