Created
June 2, 2017 04:43
-
-
Save aalonzolu/c9767c8133fa9d5a082b2731fbd7fab8 to your computer and use it in GitHub Desktop.
java sort string alphabetically / Java ordenar string alfabeticamente.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sort | |
String input = "fksjakqbjprckekdolwhnsiajskmle"; | |
char[] charArray = input.toCharArray(); | |
Arrays.sort(charArray); | |
String sortedString = new String(charArray); | |
System.out.println(sortedString); | |
// output | |
//aabcdeefhijjjkkkkkllmnopqrsssw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment