public String concat(String str) {
int otherLen = str.length();
if (otherLen == 0) {
return this;
}
int len = value.length;
char buf[] = Arrays.copyOf(value, len + otherLen);
str.getChars(buf, len);
return new String(buf, true);
}
/*
以上是jdk1.6的源码,其中的 str.getChars(buf, len);和new String(buf, true);
在帮助文档里并没有,在源码里有这样的方法,为什么开发工具里不能用呢?
谢谢回答!
*/