Is there a direct equivalent in Java for Python’s str.join? [duplicate]

For a long time Java offered no such method. Like many others I did my versions of such join for array of strings and collections (iterators).

But Java 8 added String.join():

String[] arr = { "ala", "ma", "kota" };
String joined = String.join(" ", arr);
System.out.println(joined);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)