开发者

Using a list inside the Dictionary type

I am trying to further a specific question t开发者_JS百科hat was asked and answered here. Method chaining generic list extensions

My question now is, how would I access the lists INSIDE that dictionary data type so that it would display both bits of text?


Dictionary<string,List<string>> dict; // given

foreach(var kvp in dict)
{
  Console.WriteLine(string.Format("{0}: {1}",
    kvp.Key, kvp.Value.Aggregate((c,n)=>c+=','+n)));
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜