Makes distinct and then removes a single item from a sequence.
public static IEnumerable<T> Except<T>(this IEnumerable<T> source, T item)
parameter | description |
---|---|
source | A sequence whose elements not matching the specified item will be returned. |
item | An item that will not occur in the resulting sequence. |
A sequence consisting of every distinct item in the specified sequence that does not match the specified item according to the provided (or default if not provided) equality comparer.
Makes distinct and then removes a single item from a sequence.
public static IEnumerable<T> Except<T>(this IEnumerable<T> source, T item,
IEqualityComparer<T> comparer)
parameter | description |
---|---|
source | A sequence whose elements not matching the specified item will be returned. |
item | An item that will not occur in the resulting sequence. |
comparer | Comparer used for exclusion. If not provided, default comparer is used. |
A sequence consisting of every distinct item in the specified sequence that does not match the specified item according to the provided (or default if not provided) equality comparer.