A comma separated
Fri, Mar 25, 2016Attempt to a comma-separated in Kotlin. There are several patterns. It can be written more concisely than Java.
On kotlinc-jvm fold method
>>> val list = listOf(1,2,3,4,5)
>>> list.fold(StringBuilder()) { builder, i -> builder.append("${i},") }.substring(0, list.size * 2 - 1)
1,2,3,4,5
Work in progress: kotlin-stdlib buildString
>> buildString { append(list) }
[1, 2, 3, 4, 5]