TEnumerable.Except<T> Method

Overloads

Except<T>(IEnumerable<T>, IEnumerable<T>)

Produces the set difference of two sequences by using the default equality comparer to compare values.

Except<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Produces the set difference of two sequences by using the specified equality comparer to compare values.

Except<T>(IEnumerable<T>, IEnumerable<T>)

Produces the set difference of two sequences by using the default equality comparer to compare values.

Delphi
class function Except<T>(const first: IEnumerable<T>; const second: IEnumerable<T>): IEnumerable<T>

Type Parameters

T

The type of the elements of the input sequences.

Parameters

first
IEnumerable<T>

A sequence whose elements that are not also in second will be returned.

second
IEnumerable<T>

A sequence whose elements that also occur in first will cause those elements to be removed from the returned sequence.

Returns

IEnumerable<T>

A sequence that contains the set difference of the elements of two sequences.

Exceptions

first or second is nil .

Except<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Produces the set difference of two sequences by using the specified equality comparer to compare values.

Delphi
class function Except<T>(const first: IEnumerable<T>; const second: IEnumerable<T>; const comparer: IEqualityComparer<T>): IEnumerable<T>

Type Parameters

T

The type of the elements of the input sequences.

Parameters

first
IEnumerable<T>

A sequence whose elements that are not also in second will be returned.

second
IEnumerable<T>

A sequence whose elements that also occur in first will cause those elements to be removed from the returned sequence.

comparer
IEqualityComparer<T>

An equality comparer to compare values.

Returns

IEnumerable<T>

A sequence that contains the set difference of the elements of two sequences.

Exceptions

first or second is nil .

Remarks

If comparer is nil , the default equality comparer is used to compare values.