
Ive seen example of :
int[] a1 = { 1, 2, 3 };
int[] b1 = { 1, 2, 3 };
a1.Equals(b1) //false
a1.Equals(b1,EqualityComparer<int>.Default)); //true
However I cant get the overloaded method as you see…
what am i missing ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no such method on
System.Object(or any other type that would allow such use on an array of ints).I think you’re looking for
Enumerable.SequenceEqualmethod, an extension-method from LINQ to Objects:although you might as well equivalently do:
EDIT: If you want to use the
Equalsmethod fromIStructuralEquatable, you’ll have to cast to the interface since arrays implement this interface explictly: