'In order By how to set character at first and symbol at last
Below is my code
List<User> listOfUsers = new List<User>()
{
new User() { Key = "AFG", Value = "Afghanistan" },
new User() { Key = "ALA", Value = "Åland Islands"},
new User() { Key = "BHR", Value = "Bahrain" },
new User() { Key = "ARG", Value = "Argentina"},
};
List<User> usersByAge = listOfUsers.OrderBy(user => user.Value).ToList();
foreach (User user in usersByAge)
{
var k = user.Key;
var v = user.Value;
Console.WriteLine(user.Key + ": " + user.Value);
}
class User
{
public string Key { get; set; }
public string Value { get; set; }
}
I want Åland Islands to be display at last in the list instead of second as Åland Islands has symbol instead of A
As per my code it is displaying at 2nd but I want to Åland Islands to display at last
Can anyone help me in this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
