IEnumerable<T>.Contains Method

Overloads

Contains(T)

Determines whether the sequence contains a specified element by using the default equality comparer.

Contains(T, IEqualityComparer<T>)

Determines whether the sequence contains a specified element by using a specified equality comparer.

Contains(T, TEqualityComparison<T>)

Determines whether the sequence contains a specified element by using a specified equality comparison.

Contains(T)

Determines whether the sequence contains a specified element by using the default equality comparer.

Delphi
function Contains(const value: T): Boolean

Parameters

value
T

The value to locate in the sequence.

Returns

Boolean

True if the source sequence contains an element that has the specified value; otherwise, False .

Contains(T, IEqualityComparer<T>)

Determines whether the sequence contains a specified element by using a specified equality comparer.

Delphi
function Contains(const value: T; const comparer: IEqualityComparer<T>): Boolean

Parameters

value
T

The value to locate in the sequence.

comparer
IEqualityComparer<T>

An equality comparer to compare values.

Returns

Boolean

True if the source sequence contains an element that has the specified value; otherwise, False .

Exceptions

comparer is nil .

Contains(T, TEqualityComparison<T>)

Determines whether the sequence contains a specified element by using a specified equality comparison.

Delphi
function Contains(const value: T; const comparer: TEqualityComparison<T>): Boolean

Parameters

value
T

The value to locate in the sequence.

comparer
TEqualityComparison<T>

An equality comparison to compare values.

Returns

Boolean

True if the source sequence contains an element that has the specified value; otherwise, False .

Exceptions

comparer is nil .