Metodo Java String concat()
Esempio
Concatena due stringhe:
String firstName = "John ";
String lastName = "Doe";
System.out.println(firstName.concat(lastName));
Definizione e utilizzo
Il concat()
metodo aggiunge (concatena) una stringa alla fine di un'altra stringa.
Sintassi
public String concat(String string2)
Valori dei parametri
Parameter | Description |
---|---|
string2 | A String , representing the string that
should be appended to the other string |
Dettagli tecnici
Ritorna: | A String , che rappresenta il testo delle stringhe combinate |
---|
❮ Metodi di stringa