Lookup<TKey,TElement>.Contains(TKey) Metoda

Definice

Určuje, zda je zadaný klíč v Lookup<TKey,TElement>.

public:
 virtual bool Contains(TKey key);
public bool Contains (TKey key);
abstract member Contains : 'Key -> bool
override this.Contains : 'Key -> bool
Public Function Contains (key As TKey) As Boolean

Parametry

key
TKey

Klíč, který se má najít v .Lookup<TKey,TElement>

Návraty

truepokud key je v ; Lookup<TKey,TElement>v opačném případě . false

Implementuje

Příklady

Následující příklad ukazuje, jak zjistit Contains , zda obsahuje Lookup<TKey,TElement> zadaný klíč. Tento příklad kódu je součástí většího příkladu Lookup<TKey,TElement> pro třídu.

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

Platí pro