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> 内で検索するキー。

戻り値

Boolean

keyLookup<TKey,TElement> 内にある場合は true、それ以外の場合は false

実装

次の例では、指定したキーが含まれているかどうかをLookup<TKey,TElement>判断するために使用Containsする方法を示します。 このコード例は、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)

適用対象