Is there a simple way that I can sort characters in a string in alphabetical order

Viewed 149053

I have strings like this:

var a = "ABCFE";

Is there a simple way that I can sort this string into:

ABCEF

Thanks

5 Answers

It is another.You can use SortedSet:

var letters = new SortedSet<char> ("ABCFE");
foreach (char c in letters) Console.Write (c); // ABCEF
Related