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>.

반품

true 이면 key ;이고 Lookup<TKey,TElement>, 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)

적용 대상