Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Determines whether the Hashtable contains a specific key.
Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Function Contains ( _
key As Object _
) As Boolean
public bool Contains(
Object key
)
public:
virtual bool Contains(
Object^ key
) sealed
abstract Contains :
key:Object -> bool
override Contains :
key:Object -> bool
public final function Contains(
key : Object
) : boolean
Parameters
- key
Type: System. . :: . .Object
The key to locate in the Hashtable.
Return Value
Type: System. . :: . .Boolean
true if the Hashtable contains an element with the specified key; otherwise, false.
Implements
IDictionary. . :: . .Contains(Object)
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | key is null Nothing nullptr unit a null reference (Nothing in Visual Basic) . |
Remarks
Contains implements IDictionary..::..Contains. It behaves exactly as ContainsKey.
This method is an O(1) operation.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.