Determines if the Hashtable contains a specific key.
[Visual Basic] Overridable Public Function ContainsKey( _ ByVal key As Object _ ) As Boolean [C#] public virtual bool ContainsKey( object key ); [C++] public: virtual bool ContainsKey( Object* key ); [JScript] public function ContainsKey( key : Object ) : Boolean;
true if the Hashtable contains an entry with the specified key; otherwise, false.
Exception Type | Condition |
---|---|
ArgumentNullException | key is a null reference (in Visual Basic Nothing). |
This method can be overridden by a derived class.
This implementation is an O(1) operation.
This method behaves exactly as Contains.
Hashtable Class | Hashtable Members | System.Collections Namespace | Contains | ContainsValue