ReadOnlyDictionary<TKey,TValue>.ContainsKey(TKey) ReadOnlyDictionary<TKey,TValue>.ContainsKey(TKey) ReadOnlyDictionary<TKey,TValue>.ContainsKey(TKey) ReadOnlyDictionary<TKey,TValue>.ContainsKey(TKey) Method

定義

判斷字典是否包含具有指定索引鍵的項目。Determines whether the dictionary contains an element that has the specified key.

public:
 virtual bool ContainsKey(TKey key);
public bool ContainsKey (TKey key);
abstract member ContainsKey : 'Key -> bool
override this.ContainsKey : 'Key -> bool
Public Function ContainsKey (key As TKey) As Boolean

參數

key
TKey TKey TKey TKey

要在字典中尋找的索引鍵。The key to locate in the dictionary.

傳回

如果字典包含具有指定索引鍵的項目,則為 true;否則為 falsetrue if the dictionary contains an element that has the specified key; otherwise, false.

實作

適用於