public class 快速排序 { public static void main(String[] args) { int[] arr = new int[]{5, 2, 9, 6, 22, 21}; //System.out.println(Arrays.toString(kuaiPai(arr))); // System.out.println(Arrays.asList("dada", "dda", "ddd")); //System.out.println(String.join(",", Arrays.asList("dada", "dda", "ddd"))); String s="adjj"; //第一种方法用substring来解决 System.out.println(s.substring(0, 1).toUpperCase() + s.substring(1)); //第二种方法用replace来解决 String replace = s.replace(String.valueOf(s.charAt(0)), String.valueOf(s.charAt(0)).toUpperCase()); System.out.println(replace); }