Méthode Java String concat()
Exemple
Concaténer deux chaînes :
String firstName = "John ";
String lastName = "Doe";
System.out.println(firstName.concat(lastName));
Définition et utilisation
La concat()
méthode ajoute (concatène) une chaîne à la fin d'une autre chaîne.
Syntaxe
public String concat(String string2)
Valeurs des paramètres
Parameter | Description |
---|---|
string2 | A String , representing the string that
should be appended to the other string |
Détails techniques
Retour: | A String , représentant le texte des chaînes combinées |
---|
❮ Méthodes de chaîne