Deprecated: Function set_magic_quotes_runtime() is deprecated in /nfs/c01/h08/mnt/2939/domains/cidamon.com/html/blog/textpattern/lib/txplib_db.php on line 14
Cidamon: Blog: Get Keys of Dictionary data in c#
Get Keys of Dictionary data in c#
06 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.