【初心者】 Java質問・相談スレ29 【大歓迎】
■ このスレッドは過去ログ倉庫に格納されています
0380デフォルトの名無しさん
NGNGpublic String concat(String str) {
int otherLen = str.length();
if (otherLen == 0) {
return this;
}
char buf[] = new char[count + otherLen];
getChars(0, count, buf, 0);
str.getChars(0, otherLen, buf, count);
return new String(0, count + otherLen, buf);
}
public synchronized StringBuffer append(String str) {
if (str == null) {
str = String.valueOf(str);
}
int len = str.length();
int newcount = count + len;
if (newcount > value.length)
expandCapacity(newcount);
str.getChars(0, len, value, count);
count = newcount;
return this;
}
■ このスレッドは過去ログ倉庫に格納されています