W3cubDocs

/Kotlin

sumOf

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun CharSequence.sumOf(
    selector: (Char) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun CharSequence.sumOf(
    selector: (Char) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun CharSequence.sumOf(
    selector: (Char) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun CharSequence.sumOf(
    selector: (Char) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun CharSequence.sumOf(
    selector: (Char) -> ULong
): ULong
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun CharSequence.sumOf(
    selector: (Char) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun CharSequence.sumOf(
    selector: (Char) -> BigInteger
): BigInteger

Returns the sum of all values produced by selector function applied to each character in the char sequence.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/sum-of.html