To compare two List<String> and extract their differences, I use Linq's Except.
i.e.:
Say I want to compare the following two lists for equality using Linq:
List1 = "0,1,2,2,3"
List2 = "0,1,2,3"
List<string> differences1 = List1.Except(List2).ToList();
List<string> differences2 = List2.Except(List1).ToList();
differences1 and differences2 will have no items as 2 exists in both lists, but both lists are NOT equal. I want to be able to extract all differences between the lists, including duplicate information one has that the other does not.
What is the best method of extracting all differences between two List<string> objects?