Hashtable with multiple values for single key

后端 未结 11 1498
渐次进展
渐次进展 2021-02-13 13:36

I want to store multiple values in single key like:

HashTable obj = new HashTable();
obj.Add(\"1\", \"test\");
obj.Add(\"1\", \"Test1\");

Right

11条回答
  •  既然无缘
    2021-02-13 14:17

    JFYI, you can declare your dic this way:

    Dictionary> dic = new
    {
        { 1, new List { "Test1", "test1" },
        { 2, new List { "Test2", "test2" }
    };
    

提交回复
热议问题