我在Kotlin 有一个字符串列表
private val list = ArrayList<String>()
我想用分隔符","把它转换成String
.我知道我们可以通过循环编程实现,但在其他语言中,我们可以使用映射函数,比如java中的映射函数
StringUtils.join(list);
And in Swift we have
array.joined(separator:",");
有什么方法可以将ArrayList
转换成String
吗
And what about for adding custom separator like "-" etc?