W3cubDocs

/Kotlin

count

inline fun <T> Array<out T>.count(): Int
inline fun ByteArray.count(): Int
inline fun ShortArray.count(): Int
inline fun IntArray.count(): Int
inline fun LongArray.count(): Int
inline fun FloatArray.count(): Int
inline fun DoubleArray.count(): Int
inline fun BooleanArray.count(): Int
inline fun CharArray.count(): Int

Returns the number of elements in this array.

inline fun <T> Array<out T>.count(
    predicate: (T) -> Boolean
): Int
inline fun ByteArray.count(predicate: (Byte) -> Boolean): Int
inline fun ShortArray.count(
    predicate: (Short) -> Boolean
): Int
inline fun IntArray.count(predicate: (Int) -> Boolean): Int
inline fun LongArray.count(predicate: (Long) -> Boolean): Int
inline fun FloatArray.count(
    predicate: (Float) -> Boolean
): Int
inline fun DoubleArray.count(
    predicate: (Double) -> Boolean
): Int
inline fun BooleanArray.count(
    predicate: (Boolean) -> Boolean
): Int
inline fun CharArray.count(predicate: (Char) -> Boolean): Int
inline fun <T> Iterable<T>.count(
    predicate: (T) -> Boolean
): Int

Returns the number of elements matching the given predicate.

fun <T> Iterable<T>.count(): Int
inline fun <T> Collection<T>.count(): Int

Returns the number of elements in this collection.

inline fun <K, V> Map<out K, V>.count(): Int

Returns the number of entries in this map.

inline fun <K, V> Map<out K, V>.count(
    predicate: (Entry<K, V>) -> Boolean
): Int

Returns the number of entries matching the given predicate.

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/count.html