Sort the string in descending order
char [ ] myCharArr = st . ToCharArray ( ) ; Array . Sort ( myCharArr ) ; string ns = " " ; for ( int j = myCharArr . Length - 1 ; j >= 0 ; -- j ) ns += myCharArr [ j ] ;