I know this very similar question has been asked before quite a few times such as in Comparing two collections for equality irrespective of the order of items in them, but I'm trying to use the solutions I'm reading there and something is not working... This HAS to be a stupid mistake I'm making... Please help!!
Ok, so, here's my scenario, suppose I have the following 3 lists created in code:
Dim lst1 as new list(of integer)
Dim lst2 as new list(of integer)
Dim lst3 as new list(of integer)
And then, within the code I end up with, say, the following values in the lists:
lst1: lst2: lst3:
1 1 2
2 2 3
3 3 4
4 4 5
So, obviously, lst1 & lst2 are equal and lst1 & lst3 are not, but what code can I write into my if statement to verify this?
I've tried:
lst1.SequenceEqual(lstXX)
And that returns True for both lst2 and lst3 I've tried:
lst1.Equals(lstXX)
And that returns False for both lst2 and lst3
Now, I know I could do it with code comparing count and lst1.Except(lstXX), but I'm wondering more so what I'm doing wrong here and even more importantly, what is the most efficient method to do this??
Thanks!!!