Answers for "key in dictionary c#"

C#
-1

get key in dictionary c#

public static void Main()
{
    Dictionary<string, string> dict = new Dictionary<string, string>()
    {
        {"1", "one"},
        {"2", "two"},
        {"3", "three"}
    };

    string key = KeyByValue(dict, "two");       
    Console.WriteLine("Key: " + key);
}
Posted by: Guest on November-05-2021
0

c# dictionary with dictionary as value

var collection = new Dictionary<string, Dictionary<string, int>>();
collection.Add("some key", new Dictionary<string, int>());
collection["some key"].Add("inner key", 0);
Posted by: Guest on October-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language