Phx*_*per 1 .net c# arrays string dictionary
我想将Dictionary转换为字符串数组(或列表)
字符串数组需要像这样返回:"ID,PTS",其中int是ID,long是PTS.
请帮忙!谢谢,
~Nikku.
var strings = dict.Select(item => string.Format("{0}, {1}", item.Key, item.Value));
Run Code Online (Sandbox Code Playgroud)
请注意,这将返回一个枚举器.无论你想要的形式是结果string[]还是List<string>你应该使用.ToArray()或.ToList()分别.