JavaStringjoin
format

joinString

add

Returns a new string joined with the given delimiter.

Syntax

String.join(delimiter, elements...)

Example

Enter values below to update the example in real time.

String
result
System
out
println
String result = String.join(", ", "apple", "banana", "cherry");
System.out.println(result); // "apple, banana, cherry"