reduceRight

Accumulates value starting with the last character and applying operation from right to left to each character and current accumulator value.

inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -> Char): Char(source)
val source = "kotlin"
val reversed = source.reduceRight { c, acc -> acc + c }
println(reversed) // prints "niltok"

Source