count

Common
JVM
JS
Native
1.0
fun <T> Array<out T>.count(): Int
fun ByteArray.count(): Int
fun ShortArray.count(): Int
fun IntArray.count(): Int
fun LongArray.count(): Int
fun FloatArray.count(): Int
fun DoubleArray.count(): Int
fun BooleanArray.count(): Int
fun CharArray.count(): Int

Returns the number of elements in this array.

Common
JVM
JS
Native
1.0
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.

Common
JVM
JS
Native
1.0
fun <T> Iterable<T>.count(): Int
fun <T> Collection<T>.count(): Int

Returns the number of elements in this collection.

Common
JVM
JS
Native
1.0
fun <K, V> Map<out K, V>.count(): Int

Returns the number of entries in this map.

Common
JVM
JS
Native
1.0
inline fun <K, V> Map<out K, V>.count(
    predicate: (Entry<K, V>) -> Boolean
): Int

Returns the number of entries matching the given predicate.