Kotlin Training Program

DOWNLOAD APP

FEEDBACK

count() function

To count the number of elements in a collection that match a given predicate / condition, we can use the count() function :

 // Syntax :
coll.count { /* Predicate */ }
 

Example :