📜  c# list object sort 按字母顺序 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:43.231000             🧑  作者: Mango

代码示例1
using System.Linq;

List list = new List()
{ new MyObject("Peterson", "Mike"), new MyObject("Johnson", "Tim") };

list.OrderBy((item) => item.LastName);
// In this example, the list would be arranged like so: Johnson, Peterson