是否有可能单个字符追加到数组或字符串中的Java将单个字符追加到java中的字符串或char数组中?
末例如:
private static void /*methodName*/() {
String character = "a"
String otherString = "helen";
//this is where i need help, i would like to make the otherString become
// helena, is there a way to do this?
}
我已经尝试过追加法,但是我对如何使用它非常困惑...... – CodeLover
所以*你怎么试着使用append方法?你有没有试过简单的字符串连接通过+?请注意,字符串和数组是完全不同的东西... –
@CodeLover ..你检查了String类的文档吗?它没有任何'append'方法。 Google用于'Java中的字符串串联'。也许你可以得到一些想法 –