Dictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Contains(TKey) Dictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Contains(TKey) Dictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Contains(TKey) Method

Definition

Determines whether the ICollection<T> contains a specific value.

 virtual bool System.Collections.Generic.ICollection<TKey>.Contains(TKey item) = System::Collections::Generic::ICollection<TKey>::Contains;
bool ICollection<TKey>.Contains (TKey item);
Function Contains (item As TKey) As Boolean Implements ICollection(Of TKey).Contains

Parameters

item
TKey TKey TKey

The object to locate in the ICollection<T>.

Returns

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

Implements

Remarks

Implementations can vary in how they determine equality of objects; for example, List<T> uses Default, whereas, Dictionary<TKey,TValue> allows the user to specify the IComparer<T> implementation to use for comparing keys.

This method is an O(1) operation.

Applies to