/*
* StringBuider类相关操作:
* builder.append(String str);
* builder.insert(int offset, String str);
* builder.delete(int start, int end);
* builder.toString();
* builder.reverse();
*/
public class draft {
public static void main(String[] args) {
StringBuilder s = new StringBuilder("");
s.append("How oou?");
s.insert(5, "ld are y");
System.out.println(s);
System.out.println(s.delete(4, 8).toString());
System.out.println(s.reverse().toString());
}
}
运行结果如下: