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