Set array key as string not int?

前端 未结 6 1035
耶瑟儿~
耶瑟儿~ 2020-12-03 06:58

I am trying to set the array keys as a strings like in the example below, but inC#.



        
6条回答
  •  情深已故
    2020-12-03 07:05

    Try a dictionary:

    var dictionary = new Dictionary();
    dictionary.Add("key_name", "value1");
    

提交回复
热议问题