Using stream.collect(Collectors.joining(\", \")) I can easily join all the strings of my stream delimited by a comma. A possible result would be \"a, b, c
String str = "a , b , c , d";
String what_you_want = str.substring(0, str.lastIndexOf(","))
+ str.substring(str.lastIndexOf(",")).replace(",", "and");
// what_you_want is : a , b , c and d