Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How do I get the list of keys in a Dictionary?

Dictionary<string, int> data = new Dictionary<string, int>();
data.Add("abc", 123);
data.Add("def", 456);
foreach (string key in data.Keys) // look carefully Keys is used with "s" in it
{
	Console.WriteLine(key);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #I #list #keys
ADD COMMENT
Topic
Name
7+1 =