how to fetch data from nested Dictionary in c#

前端 未结 5 1063
一向
一向 2020-12-19 14:09

I need to fetch data from nested Dictionary IN C#. My Dictionary is like this:

static Dictionary&         


        
5条回答
  •  离开以前
    2020-12-19 14:33

    try:

    string s = dict["key"][_float_];
    

    For getting whole lists you can use nested foreach loops:

            StringBuilder sb=new StringBuilder();
            foreach (var v in dict)
            {
                sb.Append(v.Key+"=>>");
                foreach (var i in v.Value)
                {
                    sb.Append(i.Key + ", " + i.Value);
                }
                sb.Append(Environment.NewLine);
            }
    
            Console.WriteLine(sb);
    

提交回复
热议问题