Language

ICollection.Contains(T) Method

Definition

Determines whether the ICollection contains a specific value.

public:
 bool Contains(T item);
public bool Contains(T item);
abstract member Contains : 'T -> bool
Public Function Contains (item As T) As Boolean

Parameters

item
T

The object to locate in the ICollection.

Returns

true if item is found in the ICollection; otherwise, false.

Remarks

Implementations can vary in how they determine equality of objects; for example, List uses EqualityComparer.Default, whereas Dictionary allows the user to specify the IEqualityComparer implementation to use for comparing keys.

Applies to