E 'possibile per aggiungere un singolo carattere alla fine di array o stringhe in JavaAggiungi un singolo carattere a una stringa o array di caratteri in java?
ad esempio:
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?
}
ho provato il metodo append ma sono molto confuso su come usarlo ... – CodeLover
Quindi * come * hai provato ad usare il metodo append? E hai provato una semplice concatenazione di stringhe tramite +? Nota che le stringhe e gli array sono cose completamente diverse ... –
@CodeLover .. Hai controllato la documentazione della classe 'String'. Non ha alcun metodo 'append'. Google per 'String Concatenation in Java'. Può essere che tu possa avere un'idea –