2013-04-15 169 views

回答

5

这可以有助于

list.OrderBy(input=>input[columnIndex]) 
2

使用Enumerable.OrderBy方法与列索引;

按升序对序列的元素进行排序。

string[] i = new string[] { "one", "two", "three" }; 
string[] j = new string[] { "four", "five", "six" }; 

List<string[]> list = new List<string[]>() {i, j}; 
var newlist = list.OrderBy(n => n[1]); 

这将返回一个新的排序列表。