0

I have a string array : Arrays.asList("str1", "str2", "str3", "str4");

And I want converti it as string with delimmotors, like this :

"str1,str2,str3,str4"

How I can do it without iterating my list ?

Hercules
  • 11
  • 2

1 Answers1

1

Yes with Java 8 :

List<String> list = Arrays.asList("str1", "str2", "str3", "str4");
String result = String.join(",", list);
Valeriane
  • 936
  • 3
  • 16
  • 37