flat
Thanks for your feedback!
Was this page helpful?
Returns a single list of all elements yielded from results of transform function being invoked on each character of original char sequence.
import kotlin.test.* fun main() { //sampleStart val list = listOf("123", "45") println(list.flatMap { it.toList() }) // [1, 2, 3, 4, 5] //sampleEnd }
xxxxxxxxxx
val list = listOf("123", "45")
println(list.flatMap { it.toList() }) // [1, 2, 3, 4, 5]
Thanks for your feedback!