Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法可以List<string>在 C# 中更改 a 的排序算法?
List<string>
如果我有清单
List<string> Names = new List<string>();
排序时我打电话
Names.Sort();
我可以覆盖使用的默认算法吗?
第二个问题
在 ASP.NET MVC3 中构建 webgrid 的排序怎么样?Webgrid 内置了排序功能,如果您指定,canSort=true您可以单击标题,行将按字母顺序排序。有没有办法我也可以改变它?
canSort=true
谢谢
有List<>.Sort()接受自定义比较器的重载。
List<>.Sort()