Map

This applies the given transform function on each item in the collection:

val numbers = listOf(1, 2, 3, 4, 5)
val strings = numbers.map { n -> n.toString() }

We used it here to transform int type to string type.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.72.15