Java文字列concat()メソッド
例
2つの文字列を連結します。
String firstName = "John ";
String lastName = "Doe";
System.out.println(firstName.concat(lastName));
定義と使用法
このconcat()
メソッドは、別の文字列の末尾に文字列を追加(連結)します。
構文
public String concat(String string2)
パラメータ値
Parameter | Description |
---|---|
string2 | A String , representing the string that
should be appended to the other string |
技術的な詳細
戻り値: | String 結合された文字列のテキストを表すA |
---|
❮文字列メソッド