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>.
반품
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)