I have an array of "Dog" where i want to print the name of all dogs older then 5 years.
I tried something like
Dogs.filter{ it.age > 5 }.forEach { it.name }
This gives me the value i need, but how do I store and return it as a list of strings? I tried things like adding .join(",") but since I don't get any array in return it wont work.