I am trying to compare every value of one list against every value of another list and then remove any matching values and currently have this code.
foreach (item s in List1)
{
for (int i = 0; i < list2.count; i++)
{
if (list2.ElementAt(i)==s)
{
list2.Remove(list2.ElementAt(i));
continue;
}
}
}
There has to be a faster or at the very least, a less intensive method of performing a comparison like this. A faster method is required as this could be used to compare lists which exceed 1000 values each. Any help would be much apreciated