String的其他功能
String replace (char old ,char new ) 全部替换之前的字符
String replace ( String old , String new ) 替换旧的字符串
String trim ( ) 去除字符串两端的空格
按照字典的顺序比较两个字符串
int compareTo ( String str ) 区分大小写
int compareToIgnoreCass (String str ) 不区分大小写
比较两个字符串的Ascll码值 前面的减去后边的 得出一个结果
public static void main(String[] args) {
String s=" helloWorld ";
String s2=s.replace("l", "k");
System.out.println(s);
System.out.println(s2);
String s3=s.replace("llo","AAAAAA");
System.out.println(s3);
System.out.println(s.trim());
System.out.println(s.compareTo(s));
System.out.println(s.compareTo(s3));
}