Answers for "c# dictionary foreach 2 and 2 items"

C#
1

c# foreach dictionary

foreach(KeyValuePair<string, string> entry in myDictionary)
{
    // do something with entry.Value or entry.Key
}
Posted by: Guest on March-03-2021
0

c# foreach on a dictionary

foreach(var item in myDictionary)
{
  foo(item.Key);
  bar(item.Value);
}
Posted by: Guest on March-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language