Metoda concat() ciągu Java
Przykład
Połącz dwa ciągi:
String firstName = "John ";
String lastName = "Doe";
System.out.println(firstName.concat(lastName));
Definicja i użycie
Metoda concat()
dołącza (konkatenuje) ciąg na końcu innego ciągu.
Składnia
public String concat(String string2)
Wartości parametrów
Parameter | Description |
---|---|
string2 | A String , representing the string that
should be appended to the other string |
Szczegóły techniczne
Zwroty: | A String , reprezentujący tekst połączonych ciągów |
---|
❮ Metody strunowe