如何使用c1
元素對List<ABC>
進行排序?非常感謝你!如何根據對象的屬性對列表進行排序
public class ABC
{
public string c0 { get; set; }
public string c1 { get; set; }
public string c2 { get; set; }
}
public partial class MainWindow : Window
{
public List<ABC> items = new List<ABC>();
public MainWindow()
{
InitializeComponent();
items.Add(new ABC
{
c0 = "1",
c1 = "DGH",
c2 = "yes"
});
items.Add(new ABC
{
c0 = "2",
c1 = "ABC",
c2 = "no"
});
items.Add(new ABC
{
c0 = "3",
c1 = "XYZ",
c2 = "yes"
});
}
}
排序? – 2013-03-17 07:15:14
@AppDeveloper:我想按c1字段對此列表進行排序。你能幫我怎麼做嗎? – Sakura 2013-03-17 07:17:41