Lookup<TKey,TElement>.Contains(TKey) メソッド

定義

指定したキーが 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

Lookup<TKey,TElement>で検索するキー。

返品

内にある場合は a0/&。それ以外の場合は。

実装

次の例では、 Contains を使用して、 Lookup<TKey,TElement> に指定したキーが含まれているかどうかを判断する方法を示します。 このコード例は、 Lookup<TKey,TElement> クラスに提供されるより大きな例の一部です。

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

適用対象