Lookup<TKey,TElement>.Contains(TKey) Méthode
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Détermine si une clé spécifiée se trouve dans 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
- key
- TKey
Clé à rechercher dans Lookup<TKey,TElement>.
true
si key
se trouve dans Lookup<TKey,TElement> ; sinon false
.
L’exemple suivant montre comment utiliser Contains pour déterminer si un Lookup<TKey,TElement> contient une clé spécifiée. Cet exemple de code fait partie d’un exemple plus grand fourni pour 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)
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :