Add to dictionary : Dictionary « Data Structure « C# / CSharp Tutorial






using System;
using System.Collections.Generic;

    public class Tester
    {
        static void Main()
        {
            Dictionary<string, string> Dictionary = new Dictionary<string, string>();
            Dictionary.Add("1", "J");
            Dictionary.Add("2", "S");
            Dictionary.Add("3", "D");
            Dictionary.Add("4", "A");
            Console.WriteLine(Dictionary["1"]);
        }
    }








11.28.Dictionary
11.28.1.Use the keys to obtain the values from a generic Dictionary
11.28.2.Add to dictionary
11.28.3.Dictionary Demo