https://kotlinlang.org logo
f

Florian

11/29/2020, 8:04 AM
Let's say I have a
List<User>
and want to get a
List<String>
of their
name
property, is there a helper method for this?
a

andylamax

11/29/2020, 8:12 AM
Copy code
val users = listOf(user1,user2,user3,user4)
val usernames = users.map {it.name}
👍 2
f

Florian

11/29/2020, 8:14 AM
thank you
oh, of course