From the MSDN documentation:
The standard Equals implementation only supports referential equality, but derived classes can override this method to support value equality.
In your case, xx and yy are two different instances of the string [], so they are never equal. You will have to override the .Equal () method of the string []
But you can just solve it by going through the entire collection
static bool CompareCollection<T>(ICollection<T> x, ICollection<T> y)
{
if (x.Length != y.Length)
return false;
for(int i = 0; i < x.Length,i++)
{
if (x[i] != y[i])
return false;
}
return true;
}
source
share