# array_rotate_right()array_rotate_right()

`dynamic` 数组中的值向右旋转。Rotates values inside a `dynamic` array to the right.

## 语法Syntax

`array_rotate_right(`arr, rotate_count`)` `array_rotate_right(`arr , rotate_count`)`

## 参数Arguments

• arr：要拆分的输入数组，必须是动态数组。arr : Input array to split, must be dynamic array.
• rotate_count：整数，用于指定数组元素将向右旋转的位置数。rotate_count : Integer specifying the number of positions that array elements will be rotated to the right. 如果该值为负数，则元素将向左旋转。If the value is negative, the elements will be rotated to the left.

## 示例Examples

• 向右旋转两个位置：Rotating to the right by two positions:

``````print arr=dynamic([1,2,3,4,5])
| extend arr_rotated=array_rotate_right(arr, 2)
``````
arrarr arr_rotatedarr_rotated
[1,2,3,4,5][1,2,3,4,5] [4,5,1,2,3][4,5,1,2,3]
• 使用负 rotate_count 值向左旋转两个位置：Rotating to the left by two positions by using negative rotate_count value:

``````print arr=dynamic([1,2,3,4,5])
| extend arr_rotated=array_rotate_right(arr, -2)
``````
arrarr arr_rotatedarr_rotated
[1,2,3,4,5][1,2,3,4,5] [3,4,5,1,2][3,4,5,1,2]