Metoda Java String concat().
Příklad
Spojte dva řetězce:
String firstName = "John ";
String lastName = "Doe";
System.out.println(firstName.concat(lastName));
Definice a použití
Metoda concat()
připojí (zřetězí) řetězec na konec jiného řetězce.
Syntax
public String concat(String string2)
Hodnoty parametrů
Parameter | Description |
---|---|
string2 | A String , representing the string that
should be appended to the other string |
Technické údaje
Vrácení: | A String , představující text kombinovaných řetězců |
---|
❮ Metody řetězců