RotateLeft

RotateLeft[expr,n]

cycles the elements in expr n positions to the left.

RotateLeft[expr]

cycles one position to the left.

RotateLeft[expr,{n1,n2,}]

cycles elements at successive levels ni positions to the left.

Details

Examples

open allclose all

Basic Examples  (4)

Rotate two positions to the left:

Rotate one position to the left:

Rotate Association one position to the left:

Rotate Association on the first and second levels:

Generalizations & Extensions  (2)

Rotate one position left at the first level, and right at the second level:

Rotate an expression with any head:

Applications  (4)

Successively rotate a list left:

Rotate successive rows of a matrix by their row number:

Rotate a 2D image:

Rotate operands:

Introduced in 1988
 (1.0)
 |
Updated in 2003
 (5.0)