StringBuffer sb = new StringBuffer();
sb.append("hello").append("world");
String str = sb.substring(5,11);
StringBuffer replace(int start, int end, String str)
StringBuffer sb = new StringBuffer();
sb.append("hello").append("world");
String str = sb.substring(5,10);
sb.replace(0, 1000, "后宫佳丽三千人,铁杵也能磨成针");
System.out.println(sb);
if (end > count)
end = count;
int len = str.length();
int newCount = count + len - (end - start);
public int length() {
return count;
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |