Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

sorting the characters in a String in java

import java.util.Arrays;

public class Test
{
    public static void main(String[] args)
    {
        String original = "edcba";
        char[] chars = original.toCharArray();
        Arrays.sort(chars);
        String sorted = new String(chars);
        System.out.println(sorted);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sorting #characters #String #java
ADD COMMENT
Topic
Name
6+7 =