小编Lem*_*mon的帖子

C#中的字典操作

我想将以下值存储到字典中:

key(字符串) - 值(字符串列表)

aaa - myfirstvalue1
aaa - myfirstvalue2

bbb - myfirstvalue3

ccc - myfirstvalue4
ccc - myfirstvalue5
Run Code Online (Sandbox Code Playgroud)

字典:

Dictionary<string, List<string> myvalues = new Dictionary<string, List<string>>();
Run Code Online (Sandbox Code Playgroud)

我试图存储这些值,但我得到了重复键错误.

c# dictionary

0
推荐指数
1
解决办法
94
查看次数

标签 统计

c# ×1

dictionary ×1