Several ways to convert an array to a comma-separated string.
JavaScript
> ['a','b','c'].join(',')
'a,b,c'
Ruby
> ['a','b','c'].join(',')
=> "a,b,c"
Python
>>> ",".join(['a','b','c'])
'a,b,c'
Java
List<String> list = Arrays.asList("a","b","c");
String result = String.join(",", list);
Recommended Posts