Lookup<TKey,TElement>.Contains(TKey) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 키가 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>에서 찾을 키입니다.
반환
key
가 Lookup<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)