字符串的相关应用
1.
String str = “1234565”;
(1) . char [] chars = str.toCharArray();//String转Char数组
chars[0]=1 chars[1]=2 .......
str = String.valueOf(chars);//Char转String
2 .
String [] str = {"add","score","bee","think"};
Arrays.sort(str);//对内部字符串按首字母升序排列
for(String i:str) {
System.out.print(i+" ");
}运行: