C# Language SequenceEqual


Example

SequenceEqual is used to compare two IEnumerable<T> sequences with each other.

int[] a = new int[] {1, 2, 3};
int[] b = new int[] {1, 2, 3};
int[] c = new int[] {1, 3, 2};

bool returnsTrue = a.SequenceEqual(b);
bool returnsFalse = a.SequenceEqual(c);