All

All is similar to any, but returns true if all the elements in the collection match the given predicate:

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

It returns false in this case because not all numbers are even.

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

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