I Have two generic list filled with CustomsObjects.
I need to retrieve the difference between those two lists(Items who are in the first without the items in the sec
here is my solution:
List list1 = new List(); List list2 = new List(); List exceptValue = new List(); foreach(String L1 in List1) { if(!List2.Contains(L1) { exceptValue.Add(L1); } } foreach(String L2 in List2) { if(!List1.Contains(L2) { exceptValue.Add(L2); } }