W3cubDocs

/Kotlin

downTo

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
infix fun Int.downTo(to: Byte): IntProgression
infix fun Long.downTo(to: Byte): LongProgression
infix fun Byte.downTo(to: Byte): IntProgression
infix fun Short.downTo(to: Byte): IntProgression
infix fun Char.downTo(to: Char): CharProgression
infix fun Int.downTo(to: Int): IntProgression
infix fun Long.downTo(to: Int): LongProgression
infix fun Byte.downTo(to: Int): IntProgression
infix fun Short.downTo(to: Int): IntProgression
infix fun Int.downTo(to: Long): LongProgression
infix fun Long.downTo(to: Long): LongProgression
infix fun Byte.downTo(to: Long): LongProgression
infix fun Short.downTo(to: Long): LongProgression
infix fun Int.downTo(to: Short): IntProgression
infix fun Long.downTo(to: Short): LongProgression
infix fun Byte.downTo(to: Short): IntProgression
infix fun Short.downTo(to: Short): IntProgression
@ExperimentalUnsignedTypes infix fun UByte.downTo(
    to: UByte
): UIntProgression
@ExperimentalUnsignedTypes infix fun UInt.downTo(
    to: UInt
): UIntProgression
@ExperimentalUnsignedTypes infix fun ULong.downTo(
    to: ULong
): ULongProgression
@ExperimentalUnsignedTypes infix fun UShort.downTo(
    to: UShort
): UIntProgression

Returns a progression from this value down to the specified to value with the step -1.

The to value should be less than or equal to this value. If the to value is greater than this value the returned progression is empty.

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.ranges/down-to.html