I have string array say string str[] = {"a", "b"}
and List<string> lst = new List<string> {"a", "b"}
How can I make sure that both string array and list contains the same values. Note: The values can be in any order but must have the same frequency.
Can anyone tell me how to do it in LINQ?
Thanks.
Okay, since order does not matter but frequncies do, you need to count each key, and then check that the resulting pairs of keys/counts are equal: