📜  c# 要列出的字典值 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:42.731000             🧑  作者: Mango

代码示例2
Dictionary dicNumber = new Dictionary();
List listNumber = new List();

dicNumber.Add("1", "First");
dicNumber.Add("2", "Second");
dicNumber.Add("3", "Third");

listNumber = dicNumber.Select(kvp => kvp.Key).ToList();
// Or:
listNumber = dicNumber.Keys.ToList();