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. |
Determines whether the sequence contains a specified element by using the default equality comparer.
function Contains(const value: T): Boolean
Parameters
- value
- T
The value to locate in the sequence.
Returns
True if the source sequence contains an element that has the
specified value; otherwise, False .
Determines whether the sequence contains a specified element by using a specified equality comparer.
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
True if the source sequence contains an element that has the
specified value; otherwise, False .
Exceptions
comparer is nil .
Determines whether the sequence contains a specified element by using a specified equality comparison.
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
True if the source sequence contains an element that has the
specified value; otherwise, False .
Exceptions
comparer is nil .