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

Use the Dictionary<TKey,TValue>.Keys property:

List<string> keyList = new List<string>(this.yourDictionary.Keys);

Leave a Comment