Arraylist of strings into one comma separated string

前端 未结 4 648
暗喜
暗喜 2021-01-15 11:57

Trying to convert a Arraylist of strings into one big comma separated string.

However when I use the

String joined = TextUtils.join(\", \", partici         


        
4条回答
  •  庸人自扰
    2021-01-15 12:30

    Try with kotlin

    val commaSeperatedString = listOfStringColumn.joinToString { it -> 
     "\'${it.nameOfStringVariable}\'" }
    

    // output: 'One', 'Two', 'Three', 'Four', 'Five'

提交回复
热议问题