所以我有一个 List
的 Dictionary<string, string> dict
我想对 List
进行排序按字母顺序关闭 dict["Title"]
值(value)。
我该怎么做?
而且,如果我想取 dict["Title"]
的值怎么办? ,修改为string title = dict["Title"] + "xyz";
, 然后使用修改后的 title
作为 dict
的排序值(实际上没有改变 dict["Title"]
)...
我该怎么做呢?
谢谢。
最佳答案
链接它:
var dicts = new List<Dictionary<string, string>>();
var sort = dicts.OrderBy(x => x.ContainsKey("Title") ? x["Title"] : string.Empty);
var sort2 = dicts.OrderBy(x => x.ContainsKey("Title") ? x["Title"] + "xyz" : string.Empty);
关于c# - 在 C# .NET Silverlight 中,如何根据字典中键中的值对字典列表进行排序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9627214/