Thursday, March 22, 2012

C#/VB.NET - Iterate through a Dictionary - Generic Collection

The cleanest and most straight forward way to iterate through a Dictionary is as follows:

 
foreach(KeyValuePair<int,String> valuePair in dict)  
 {  
    int i = entry.Key;  
    string s = entry.Value;  
 }  

No comments:

Post a Comment