How to iterate over a dictionary in C#?

6:30:00 AM 0 Comments A+ a-

Here is a simple way to iterate over items in a dictionary:

foreach(KeyValuePair<string, string> entry in myDictionary)
{
    // you can use here entry.Value
    // or entry.Key
}