dictionary class : ContainsKey(string) method
Description
Gets a value that indicates whether the specified key is contained in the dictionary.
Syntax
dictionaryInstance.ContainsKey(string key)
Arguments
Class | Name | Description |
string | key | Key to be searched. |
Return value
Class | Description |
bool | A value that indicates whether the specified key is contained in the dictionary. |
Sample code
//anyDictionary is a instance of dictionary{string} type.
bool contain = anyDictionary.ContainsKey("ww");
Notes
It's a wrapper of the System.Collections.Generic.Dictionary<TKey, TValue>.ContainsKey(TKey).