开发者

Using a list inside the Dictionary type

开发者 https://www.devze.com 2023-02-03 01:21 出处:网络
I am trying to further a specific question t开发者_JS百科hat was asked and answered here. Method chaining generic list extensions

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

精彩评论

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

关注公众号