Método Java String concat()
Exemplo
Concatenar duas strings:
String firstName = "John ";
String lastName = "Doe";
System.out.println(firstName.concat(lastName));
Definição e uso
O concat()
método anexa (concatenar) uma string ao final de outra string.
Sintaxe
public String concat(String string2)
Valores de parâmetro
Parameter | Description |
---|---|
string2 | A String , representing the string that
should be appended to the other string |
Detalhes técnicos
Devoluções: | A String , representando o texto das strings combinadas |
---|
❮ Métodos de String