Contains Method
Collapse the table of content
Expand the table of content

Lookup(Of TKey, TElement).Contains Method

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

Determines whether a specified key is in the Lookup(Of TKey, TElement).

Namespace:  System.Linq
Assembly:  System.Core (in System.Core.dll)

'Declaration
Public Function Contains ( _
	key As TKey _
) As Boolean

Parameters

key
Type: TKey
The key to find in the Lookup(Of TKey, TElement).

Return Value

Type: System.Boolean
true if key is in the Lookup(Of TKey, TElement); otherwise, false.

Implements

ILookup(Of TKey, TElement).Contains(TKey)

The following example demonstrates how to use Contains to determine whether a Lookup(Of TKey, TElement) contains a specified key. This code example is part of a larger example provided for the Lookup(Of TKey, TElement) class.


' Determine if there is a key with the value 'G' in the Lookup.
Dim hasG As Boolean = lookup.Contains("G"c)


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft