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

Definizione

Determina se una chiave specificata si trova nell'oggetto 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

Parametri

key
TKey

Chiave da trovare in Lookup<TKey,TElement>.

Valori restituiti

true se key è in ; in Lookup<TKey,TElement>caso contrario, false.

Implementazioni

Esempio

Nell'esempio seguente viene illustrato come utilizzare Contains per determinare se un Lookup<TKey,TElement> oggetto contiene una chiave specificata. Questo esempio di codice fa parte di un esempio più ampio fornito per la Lookup<TKey,TElement> classe .

// 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)

Si applica a