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

ClassNameDescription
stringkeyKey to be searched.

Return value

ClassDescription
boolA 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).

Links for reference

Copyright © Rice All rights reserved.