Hi, I have two Arrays/Lists which I want to compare with each other. What is the best way to do this?
I.e. Array1 and List2, Does List2 have the same elements and number of elements as Array1? Does not matter in what order the elements are organized.
Currently I am looping through the first array/list and then nesting a loop through the other array/list… but this approach is kind of messy when facing issue of duplicates etc
@DEATHFISH
give a try on arr1.Intersect(arr2).Count = arr1.length
for a quick check
Let us know if you need a more detailed check e.g. cross checking more details from arr2
Working with the Set Operations (Intersect, Except) is very helpfully. In some cases it requires . This It can ommit the the-both-have-same-length-check Compare_SequenceEqual.xaml (5.4 KB)