Skip to main content

How to iterate over a dictionary in C#?

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
}


Comments

Popular posts from this blog