What is the better way to Navigate through a dictionary ? I used to use the code below when i had IDictionary:
Assume that I have IDictionary named freq
IEnumerator enums = freq.GetEnumerator();
while (enums.MoveNext())
{
string word = (string)enums.Key;
int val = (int)enums.Value;
.......... and so on
}
but now, I want to do the same thing using dictionary
The
foreachstatement iterates automatically through enumerators.