I have below ObservableCollection<string>
. I need to sort this alphabetically.
private ObservableCollection<string> _animals = new ObservableCollection<string>
{
"Cat", "Dog", "Bear", "Lion", "Mouse",
"Horse", "Rat", "Elephant", "Kangaroo", "Lizard",
"Snake", "Frog", "Fish", "Butterfly", "Human",
"Cow", "Bumble Bee"
};
I tried _animals.OrderByDescending
. But I don't know how to use it correctly.
_animals.OrderByDescending(a => a.<what_is_here_?>);
How can I do this?