This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Operations  /
RotateLeft

  • RotateLeft[ expr , n ] cycles the elements in expr n positions to the left.
  • RotateLeft[ expr ] cycles one position to the left.
  • RotateLeft[ expr , , , ... ] cycles elements at successive levels positions to the left.
  • Example: RotateLeft[ a, b, c , 1].
  • RotateLeft[ expr , - n ] rotates n positions to the right.
  • See the Mathematica book: Section 1.8.9.
  • See also: Reverse.

    Further Examples

    This rotates each element one place to the left.

    In[1]:=

    Out[1]=

    This rotates each element two places to the left.

    In[2]:=

    Out[2]=

    This rotates each element one place to the right.

    In[3]:=

    Out[3]=