📅  最后修改于: 2022-03-11 14:52:14.308000             🧑  作者: Mango
public static void main(String[] args) {
StringBuffer buf = new StringBuffer("123456789");
int start = 3;
int end = 6;
buf.replace(start, end, "foobar");
System.out.println(buf);
}
}