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
@ExperimentalUnsignedTypes inline fun UIntArray.count(
    predicate: (UInt) -> Boolean
): Int
@ExperimentalUnsignedTypes inline fun ULongArray.count(
    predicate: (ULong) -> Boolean
): Int
@ExperimentalUnsignedTypes inline fun UByteArray.count(
    predicate: (UByte) -> Boolean
): Int
@ExperimentalUnsignedTypes inline fun UShortArray.count(
    predicate: (UShort) -> 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.