reverse

fun <T> Array<T>.reverse()(source)

Reverses elements in the array in-place.

Since Kotlin

1.0

fun <T> Array<T>.reverse(fromIndex: Int, toIndex: Int)(source)
fun ByteArray.reverse(fromIndex: Int, toIndex: Int)(source)
fun ShortArray.reverse(fromIndex: Int, toIndex: Int)(source)
fun IntArray.reverse(fromIndex: Int, toIndex: Int)(source)
fun LongArray.reverse(fromIndex: Int, toIndex: Int)(source)
fun FloatArray.reverse(fromIndex: Int, toIndex: Int)(source)
fun DoubleArray.reverse(fromIndex: Int, toIndex: Int)(source)
fun BooleanArray.reverse(fromIndex: Int, toIndex: Int)(source)
fun CharArray.reverse(fromIndex: Int, toIndex: Int)(source)
inline fun UIntArray.reverse(fromIndex: Int, toIndex: Int)(source)
inline fun ULongArray.reverse(fromIndex: Int, toIndex: Int)(source)
inline fun UByteArray.reverse(fromIndex: Int, toIndex: Int)(source)
inline fun UShortArray.reverse(fromIndex: Int, toIndex: Int)(source)

Reverses elements of the array in the specified range in-place.

Since Kotlin

1.4

Parameters

fromIndex

the start of the range (inclusive) to reverse.

toIndex

the end of the range (exclusive) to reverse.

Throws

if fromIndex is less than zero or toIndex is greater than the size of this array.


Reverses elements in the array in-place.

Since Kotlin

1.3

expect fun <T> MutableList<T>.reverse()(source)

Reverses elements in the list in-place.

Since Kotlin

1.0
actual fun <T> MutableList<T>.reverse()(source)

Reverses elements in the list in-place.

Since Kotlin

1.1
actual fun <T> MutableList<T>.reverse()(source)

Reverses elements in the list in-place.

Since Kotlin

1.0
actual fun <T> MutableList<T>.reverse()(source)

Reverses elements in the list in-place.

Since Kotlin

1.3
actual fun <T> MutableList<T>.reverse()(source)

Reverses elements in the list in-place.

Since Kotlin

1.8
actual fun <T> MutableList<T>.reverse()(source)

Reverses elements in the list in-place.

Since Kotlin

1.8