string s = "Zbcdefg";

string str = new String(s.ToCharArray().OrderByDescending(x => x).ToArray());

Console.WriteLine(str);

 

결과값 : gfedcbZ

============================================

string s = "gfedcbZ";

string str = new String(s.ToCharArray().OrderBy (x => x).ToArray());

Console.WriteLine(str);

 

결과값 : Zbcdefg

 

참고 및 출처 : scalability.tistory.com/28

+ Recent posts