In LINQ, Set operators are those operators in query expression which return a result set based on the existence or non-existence of the equivalent elements within the same or different collections or sequences or sets. The standard query operator contains the following set operators:
The Except operator returns the set difference. Or in other words, we can say that it returns the set or collection which contain the elements that do not appear in the second collection or set.
- It does not support Query Syntax in C# and VB.Net languages. But you can use Except method on query variable or you can wrap your query in brackets and then call Except method.
- 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.
- When you are working with the collections of complex types, then you must use IEqualityComparer interface, otherwise, the Except method will give you incorrect result.
Sequence 1 is: m q o s y a Sequence 2 is: p t r s y z New Sequence: m q o a
- LINQ | Quantifier Operator | All
- LINQ | Element Operator | First
- LINQ | Quantifier Operator | Any
- LINQ | Quantifier Operator | Contains
- LINQ | Filtering Operator | where
- LINQ | Element Operator | Last
- LINQ | Set Operator | Intersect
- LINQ | Set Operator | Union
- LINQ | Partition Operator | Take
- LINQ | Set Operator | Distinct
- LINQ | Generation Operator | DefaultIfEmpty
- LINQ | Element Operator | ElementAtOrDefault
- LINQ | Projection Operator | Select
- LINQ | Projection Operator | SelectMany
- LINQ | Sorting Operator | OrderBy
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.