I have tried str.split(,).toTypedArray(), but it doesn’t make an array.
var tasks = ""
tasks.plus(",").plus("Hey")
tasks.plus(",").plus("Hey")
tasks.plus(",").plus("Hey")
tasks.plus(",").plus("Hey")
val array = tasks.split(",").toTypedArray()
array.forEach {println(it)}
the output returns nothing so far.
Is there a way to split the string where the input is:
"xyx yxy xyx"
and get an output:
["xyx","yxy","xyx"]