rotateRight
Rotates the Array to the right by specified distance.
Example:
arrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the ByteArray to the right by specified distance.
Example:
byteArrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the ShortArray to the right by specified distance.
Example:
shortArrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the CharArray to the right by specified distance.
Example:
charArrayOf('a', 'b', 'c', 'd', 'e').rotateRight(2) // ['c', 'd', 'e', 'a', 'b']
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the IntArray to the right by specified distance.
Example:
intArrayOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the LongArray to the right by specified distance.
Example:
longArrayOf(1L, 2L, 3L, 4L, 5L).rotateRight(2) // [3L, 4L, 5L, 1L, 2L]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the FloatArray to the right by specified distance.
Example:
floatArrayOf(1F, 2F, 3F, 4F, 5F).rotateRight(2) // [3F, 4F, 5F, 1F, 2F]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the DoubleArray to the right by specified distance.
Example:
doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0).rotateRight(2) // [3.0, 4.0, 5.0, 1.0, 2.0]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the BooleanArray to the right by specified distance.
Example:
booleanArrayOf(true, false, true, false, true).rotateRight(2) // [true, false, true, true, false]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.
Rotates the Iterable to the right by specified distance.
Example:
listOf(1, 2, 3, 4, 5).rotateRight(2) // [3, 4, 5, 1, 2]
Since
1.1.0
Parameters
number of elements rotate
See also
Throws
if n is negative or zero.