ContainsKey Method
Collapse the table of content
Expand the table of content

IReadOnlyDictionary(Of TKey, TValue).ContainsKey Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Determines whether the read-only dictionary contains an element that has the specified key.

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

'Declaration
Function ContainsKey ( _
	key As TKey _
) As Boolean

Parameters

key
Type: TKey
The key to locate.

Return Value

Type: System.Boolean
true if the read-only dictionary contains an element that has the specified key; otherwise, false.

ExceptionCondition
ArgumentNullException

key is Nothing.

Implementations can vary in how they determine the equality of objects; for example, the class that implements IReadOnlyDictionary(Of TKey, TValue) might use the Comparer(Of T).Default property, or it might implement the IComparer(Of T) method.

Implementations can vary in whether they allow key to be Nothing.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft