![]() The function returns true if at least one element matches the given predicate. The syntax of List.any() function with a predicate passed to it is ![]() So, the working of any() depends on if an argument is given to it. The Kotlin List.any(predicate) function checks if any one of element in the list matches the given predicate. The Kotlin List.any() function checks if there is at least one element in the list, and returns a boolean value. To check if at least one of the elements of this List satisfy a given condition/predicate, call any() function on this List object and pass the predicate as argument to the function. Kotlin List – Check if any of the Elements Satisfy a Given Condition
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |