Two sequences whose corresponding elements are equal and which have the same number of elements are considered equal.
SequenceEqual
Determines whether two sequences are equal by comparing elements in a pair-wise manner.
Method Syntax
// SequenceEqual
var numbers1 = new int[] { 1, 2, 3, 4, 5 };
var numbers2 = new int[] { 1, 2, 3, 4, 5 };
var equals = numbers1.SequenceEqual(numbers2);
// equals = true
Query Syntax
// Not Applicable.