how to sort string array alphabetically in c#
Array.Sort(names, (x,y) => String.Compare(x.Name, y.Name));
how to sort string array alphabetically in c#
Array.Sort(names, (x,y) => String.Compare(x.Name, y.Name));
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us