Deprecated: Function set_magic_quotes_runtime() is deprecated in /nfs/c01/h08/mnt/2939/domains/ on line 14
Cidamon: Blog: Get Keys of Dictionary data in c#
Get Keys of Dictionary data in c#
07 November, 2010

A very simply way to collect the keys of a dictionary object to iterate through them is given bellow –

List<string> keyList = new List<string>(myDictionary.Keys);
for (int i = 0; i < keyList.Count; i++)
    int myInt = myDictionary[keyList[i]];


Commenting is closed for this article.