Array that can be accessed using array['Name'] in C#

前端 未结 3 1328
心在旅途
心在旅途 2021-02-08 00:38

Can you do

array[\'Name\'];

In C#

Rather than:

array[0];

I know you can do that in PHP but is there a

3条回答
  •  无人共我
    2021-02-08 01:02

    Dictionary myDic =
                                new Dictionary();
    myDic.Add("Name", instanceOfWhatIWantToStore);   
    myDic["Name"];
    

提交回复
热议问题