I am trying to Compare two lists and keep on each list only items that are unique to each list. Could you assist?
I know how to do intersection, but I actually need to do the opposite
//Example
List<String> baseListCopy = new List<String>();
baseListCopy.Add("Test1");
baseListCopy.Add("Test2");
baseListCopy.Add("Test3");
baseListCopy.Add("Test4");
baseListCopy.Add("Test5");
baseListCopy.Add("Test6");
baseListCopy.Add("Test7");
baseListCopy.Add("Test8");
baseListCopy.Add("Test9");
List<String> resultListCopy = new List<String>();
resultListCopy.Add("Test1");
resultListCopy.Add("Test2");
resultListCopy.Add("Test3");
resultListCopy.Add("Test40");
resultListCopy.Add("Test90");
//returns only items that are present on both lists
resultListCopy = baseListCopy.Intersect(resultListCopy, StringComparer.InvariantCultureIgnoreCase).ToList();
//How do I return only items that are unique to that list?
To get all results that are not contained in
resultListCopy: