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 ?
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 ?
Yes with Java 8 :
List<String> list = Arrays.asList("str1", "str2", "str3", "str4");
String result = String.join(",", list);