Solutions
Multiplatform
Server-side
Data science
Android
Docs
Community
Teach
Play
Playground
Examples
Koans
Kotlin libraries
Toggle table of contents
2.2
Select version
2.2
2.1
2.0
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0
Common
JS
JVM
Native
Wasm-JS
Wasm-WASI
Platform filter
Common
JS
JVM
Native
Wasm-JS
Wasm-WASI
Switch theme
Search in API
Kotlin libraries
kotlin-stdlib
/
kotlin.collections
/
reverse
reverse
Common
JS
JVM
Native
Wasm-JS
Wasm-WASI
fun
<
T
>
Array
<
T
>
.
reverse
(
)
(
source
)
fun
ByteArray
.
reverse
(
)
(
source
)
fun
ShortArray
.
reverse
(
)
(
source
)
fun
IntArray
.
reverse
(
)
(
source
)
fun
LongArray
.
reverse
(
)
(
source
)
fun
FloatArray
.
reverse
(
)
(
source
)
fun
DoubleArray
.
reverse
(
)
(
source
)
fun
BooleanArray
.
reverse
(
)
(
source
)
fun
CharArray
.
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
)
@
ExperimentalUnsignedTypes
inline
fun
UIntArray
.
reverse
(
fromIndex
:
Int
,
toIndex
:
Int
)
(
source
)
@