Many Kotlin collections have a filter() function. It takes a lambda expression that accepts a single element from the collection as a parameter. filter() then returns the subset of items in the collection for which that lambda expression returns true. As the name suggests, you can use this for filtering a larger collection to find a relevant subset.

You can learn more about this in:
Run Expand Edit