sumBy

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

Deprecated

Use sumOf instead.

Replace with

this.sumOf(selector)

Returns the sum of all values produced by selector function applied to each element in the array.

Since Kotlin

1.0

inline fun <T> Iterable<T>.sumBy(selector: (T) -> Int): Int(source)

Deprecated

Use sumOf instead.

Replace with

this.sumOf(selector)

Returns the sum of all values produced by selector function applied to each element in the collection.

Since Kotlin

1.0