Answers for "c# list object sort alphabetically"

C#
0

c# list object sort alphabetically

using System.Linq;

List<MyObject> list = new List<MyObject>()
{ 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
Posted by: Guest on September-14-2021

Code answers related to "c# list object sort alphabetically"

C# Answers by Framework

Browse Popular Code Answers by Language