.net 中Dictionary的遍历

            Dictionary < int int >  dict  =   new  Dictionary < int int > ();
            dict.Add(
200 1 );
            dict.Add(
100 2 );
            dict.Add(
50 3 );
            dict.Add(
20 4 );
            
foreach ( KeyValuePair < int , int >  entry  in  dict)
            {
                Console.WriteLine(
                    
string .Format( " key:{0}/nvalues:{1}/n " ,
                                  entry.Key,
                                  entry.Value
                                 )
                );
            }
示例一出....就全明白了...
 

你可能感兴趣的:(.net,String,Dictionary)