The equality operator is used to check whether the given two sequences are identically equal or not. In LINQ, the equality operation contains only one operator that is known as SequenceEqual. It is used to check whether the given elements in the sequence or collection are equal or not. If the given sequences or collections are equal then it returns true otherwise return false.
- It compares the value and the numbers of elements, if the collection or sequence has primitive data types.
- It checks the references of the objects, if the collection has complex type elements.
- It does not support query syntax in C# and VB.Net languages.
- It support method syntax in both C# and VB.Net languages.
- It present in both the Queryable and Enumerable class.
- It is implemented by using deferred execution.
- You are allowed to use IEqualityComparer class to compare two collections of complex type using SequenceEqual method.
Sequence 1 is: p q r s y z Sequence 2 is: p q r s y z Given Sequences are equal: True
- Uri.Equality() Operator in C# with Examples
- LINQ | Set Operator | Except
- LINQ | Filtering Operator | where
- LINQ | Set Operator | Distinct
- LINQ | Set Operator | Intersect
- LINQ | Set Operator | Union
- LINQ | Element Operator | First
- LINQ | Quantifier Operator | Contains
- LINQ | Quantifier Operator | Any
- LINQ | Quantifier Operator | All
- LINQ | Partition Operator | Take
- LINQ | Element Operator | Last
- LINQ | Sorting Operator | ThenByDescending
- LINQ | Partition Operator | Skip
- LINQ | Filtering Operator | OfType
- LINQ | Concatenation Operator | Concat
- LINQ | Projection Operator | SelectMany
- LINQ | Partition Operator | TakeWhile
- LINQ | Partition Operator | SkipWhile
- LINQ | Projection Operator | Select
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.