Method Contains
Contains(T, IEqualityComparer<T>?)
Determines whether the list contains a value that is equal to the specified value.
Declaration
public bool Contains(T value, IEqualityComparer<T>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value to search for. |
| IEqualityComparer<T> | comparer | The comparer to use to determine equality, or null to use the default comparer. |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
This operation enumerates the list, so it takes O(n) time plus the cost of the comparisons. Nodes added by other threads during the search are not considered.
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The list has been disposed. |