Okay, just learnt LINQ syntax about ten minutes ago, made a first program:
public static void Main(string[] args)
{
char[] letters = {'d','a','C','n','D','e','R','f'};
List<char> tokens =
(from l in letters
where char.IsLower(l)
select l).ToList();
}
Now, as I was skimming through it, I saw an orderby keyword. But I can’t grasp it’s usage or capabilities. For example, in this case, can it be used to alphabetically order the tokens? If so, then how?
This will sort it according to ASCII value. If you want to sort simply, alphabetically try this:
this will take all chars from
letters, not only these wherechar.IsLower(l) == true