在我的通用列表中包含整数和字符串值。我如何执行OrderBy或OrderByDescending。
例如
List<String> codelst = new List<string>() { "1","2","3","4","5","10","100","a12","b12" };
codelst.OrderBy(g => g);
如下所示
1
10
100
2
3
5
a12
b12
但需要显示
1
2
3
5
10
100
a12
b12
如果我转换为int,则显示输入字符串错误
codelst.OrderBy(g => Convert.ToInt32(g));
如何实现这个