【发布时间】:2016-07-29 07:30:27
【问题描述】:
我有这个列表:
List<Dictionary<string, string>> testList= new List<Dictionary<string, string>>();
那么如何从每个 Dictionary 中获取值呢?
我知道我可以通过索引获取字典,例如:
testList[index]
但我不知道如何从Dictionary 中按键获取值。
【问题讨论】:
-
你试过 testList[index][key] 吗?
-
哦,是的,谢谢!我想知道为什么没有人有这个问题。我用谷歌搜索了 10 分钟没有成功
-
因为您可以在 Google 上搜索 c# dictionary 并转到 MSDN。然后向下滚动到Item 属性。
-
只是有毒的stackoverflow...
标签: c#