In my String, I can have an arbitrary number of words which are comma separated. I wanted each word added into an ArrayList. E.g.:
String s = \"a,b,c,d,e,...
This is using Gson in Kotlin
val listString = "[uno,dos,tres,cuatro,cinco]" val gson = Gson() val lista = gson.fromJson(listString , Array::class.java).toList() Log.e("GSON", lista[0])