排序列表<tuple <string,class =“”>&gt;字母顺序为元组的字符串值,C#</tuple <string,>

时间:2012-09-15 13:49:36

标签: c# list sorting

如何按元组的字符串项的值按升序对list(Tuple<string, class>)进行排序?

2 个答案:

答案 0 :(得分:5)

var ordered = myList.OrderBy(t => t.Item1).ToList();

答案 1 :(得分:0)

list.OrderBy(x => x.Item1); 

假设您的string位于Item1