我想改变字典键值的格式。
有点像
Dictionary<string,string> dictcatalogue = new Dictionary<string,string>();
dictCatalogue = dictCatalogue.Select(t => t.Key.ToString().ToLower() + "-ns").ToDictionary();
如何在不影响值的情况下更改字典的键
最佳答案
您创建新词典的方向是正确的:
dictcatalogue = dictcatalogue.ToDictionary
(t => t.Key.ToString().ToLower() + "-ns", t => t.Value);
关于c# - 格式化字典的键值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16299010/