Java 区切り文字で文字列を連結するサンプル
環境
Java 17
Windows 11 Pro 64bit
構文
String.join(“区切り文字", “文字列1", “文字列2", “文字列3")
指定した区切り文字で文字列を連結するには、「join」を使用します。
使用例
public class Testd {
    public static void main(String[] args) throws Exception {
        String arr[] = {"tot", "bbb", "ccc"};
        System.out.println(String.join(",", arr));
        
    }
}
結果
tot,bbb,ccc