Determines if the SortedList 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 SortedList contains an element 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 method uses a binary search algorithm; therefore, the average execution time is proportional to Log2 (size), where size is the size of the SortedList.This method behaves exactly as Contains.
SortedList Class | SortedList Members | System.Collections Namespace | Contains | ContainsValue | IndexOfKey