Mono Class Library: System.Collections.Hashtable Overview | Members

System.Collections.Hashtable.ContainsKey Method

Determines whether the current instance contains an entry with the specified key. [Edit]

public virtual bool ContainsKey (object key)

Parameters

key
The key of the entry to locate in the current instance. [Edit]

Returns

true if the current instance contains an entry with key; otherwise, false. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionkey is null. [Edit]

Remarks

Operation
As described above.

This method uses Hashtable.KeyEquals(object, object) to compare key to the keys in the current instance.

Note: For the default implementation, this method has a constant (O(1)) lookup time.

[Edit]

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0