C#中List如何按照两种条件进行排序
背景描述:项目中有一个List<Bolt> BoltResultSQLList
其中Bolt.BoltNum的格式为“A-1”,“B-1”,“A-2”,“A-3”,“C-1”等任意排列组合
需求:现在想对List<Bolt>进行排序:按照A-B-C为首要条件,数字为第二条件。
结果示意:A-1,A-2,A-3,B-1,C-1
public class Bolt
{
private string _BoltNum = "1";
///要进行排序的字段
publi
原创
2021-08-25 14:37:22 ·
1479 阅读 ·
0 评论