string不能修改 ,只能创建新的更改指向

stringbuffer可以修改

常用方法

1 public StringBuffer append(String s) 将指定的字符串追加到此字符序列。
2 public StringBuffer reverse() 将此字符序列用其反转形式取代。
3 public delete(int start, int end) 移除此序列的子字符串中的字符。
4 public insert(int offset, int i) 将 int 参数的字符串表示形式插入此序列中。
5 replace(int start, int end, String str) 使用给定 String 中的字符替换此序列的子字符串中的字符。