Ink
05/06/2022, 8:45 PMdata class Foo(val price: Int?)
val items = List<Foo>(Foo(133), Foo(324), Foo(3))
How I can get List<Int?>
with all prices?
Is it only solution?
https://medium.com/@hayi/kotlin-get-list-of-some-property-values-of-object-from-list-of-object-8da9419c2e77Dariusz Kuc
05/06/2022, 8:50 PMChris Lee
05/06/2022, 8:50 PMval prices = items.map { it.price }
phldavies
05/06/2022, 8:50 PMitems.map { it.price }
Ink
05/06/2022, 9:06 PM