how can i obtain the arrays of strings from the map string and return them?

It is stored as an (Array)List. So just get and use it as a List:

val myStrings = map["myStrings"] as List<String>

If you need to edit the list later on you can cast it to MutableList:

val myStrings = map["myStrings"] as MutableList<String>

If you really need it to be an Array, though for most cases you don’t, you’ll have to convert the List to an array:

val myStringsArray = myStrings.toTypedArray()

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top