Most elegant way to convert string array into a dictionary of strings

后端 未结 8 1032
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 18:39

Is there a built-in function for converting a string array into a dictionary of strings or do you need to do a loop here?

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 19:14

    If you need a dictionary without values, you might need a HashSet:

    var hashset = new HashSet(stringsArray);
    

提交回复
热议问题