Share via


Contains Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Determines whether the IDictionary object contains an element with the specified key.

Namespace:  System.Collections
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Function Contains ( _
    key As Object _
) As Boolean
bool Contains(
    Object key
)
bool Contains(
    Object^ key
)
abstract Contains : 
        key:Object -> bool 
function Contains(
    key : Object
) : boolean

Parameters

Return Value

Type: System. . :: . .Boolean
true if the IDictionary contains an element with the key; otherwise, false.

Exceptions

Exception Condition
ArgumentNullException

key is null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

Remarks

Implementations can vary in whether they allow the key to be null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

.NET Framework Security

See Also

Reference

IDictionary Interface

System.Collections Namespace