IEnumerable<T>.Intersect Method

Overloads

Intersect(IEnumerable<T>)

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

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

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

Intersect(IEnumerable<T>)

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

Delphi
function Intersect(const second: IEnumerable<T>): IEnumerable<T>

Parameters

second
IEnumerable<T>

A sequence whose distinct elements that also appear in the first sequence will be returned.

Returns

IEnumerable<T>

A sequence that contains the elements that form the set intersection of two sequences.

Exceptions

second is nil .

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

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

Delphi
function Intersect(const second: IEnumerable<T>; const comparer: IEqualityComparer<T>): IEnumerable<T>

Parameters

second
IEnumerable<T>

A sequence whose distinct elements that also appear in the first sequence will be returned.

comparer
IEqualityComparer<T>

An equality comparer to compare values.

Returns

IEnumerable<T>

A sequence that contains the elements that form the set intersection of two sequences.

Exceptions

second is nil .