c# and linq: want {1,1,2,3} == {1,2,3,1} returns true but {1,1,2,3} == {1,2,3} returns false
- by dFlat
I have two sets, both IEnumerables, and I want to compare them.
string[] names1 = { "tom", "dick", "harry" };
string[] names2 = { "tom", "dick", "harry", "harry"};
string[] names3 = { "tom", "dick", "harry", "sally" };
string[] names4 = { "dick", "harry", "tom" };
Want names1 == names4 to return true (and self == self returns true obviously)
But…