📜  排序字符串 java - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:06.004000             🧑  作者: Mango

代码示例1
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);
    }
}