I've created and populated a generic list of strings like this:
Dim MyList As New List(Of String)
MyList.Add("Beta")
MyList.Add("Echo")
MyList.Add("Charlie")
MyList.Add("Alpha")
MyList.Add("Delta")
Now I want to order it.
You can use LINQ to create a new list which contains the original values but sorted: var sortedList = list. OrderBy(x => x). ToList();
Doesn't this work?
MyList.Sort()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With