【发布时间】:2023-04-09 10:51:01
【问题描述】:
我有一本字典 Dictionary
Dictionary<string, string[]> dictionary = new Dictionary<string, string[]>
{
{
"key1",
new string[] { "item1", "item2", "item3" }
},
{
"key2",
new string[] { "item1", "item4" }
}
};
感谢您的帮助!
【问题讨论】:
-
你尝试了什么?以
dictionary.Where(kvp ... )开始 -
ToDictionary 只接受参数,不确定您需要如何帮助。也许先使用 groupby?
标签: c# linq dictionary