Any

Any returns true if the supplied predicate function matches any of the collection items:

val numbers = listOf(1, 2, 3, 4, 5)
val hasEvens = numbers.any { n -> n % 2 == 0 }

Any would return true in this case, as the predicate matches two items.

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

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