Answers for "c# init dictionary with values"

C#
3

init dictionary c#

var myDict = new Dictionary<string, string>
{
    { "key1", "value1" },
    { "key2", "value2" }
};
Posted by: Guest on April-15-2021
1

init dictionary c#

Dictionary<int,string> dict = new Dictionary<int, string>();
dict.Add(1, "Mohan");
dict.Add(2, "Kishor");
dict.Add(3, "Pankaj");
dict.Add(4, "Jeetu");
Posted by: Guest on April-15-2021
0

init dictionary c#

static class Program
{
    static void Main(string[] args)
    {
        var myDict = new Dictionary<string, string>
        {
            { "key1", "value1" },
            { "key2", "value2" }
        };

        Console.ReadKey();
    }
}
Posted by: Guest on March-03-2022

Code answers related to "c# init dictionary with values"

C# Answers by Framework

Browse Popular Code Answers by Language