Rotate - Maple Help

StringTools

 Rotate
 rotate the characters in a string by a given amount

 Calling Sequence Rotate( s, offset )

Parameters

 s - Maple string offset - integer; number of characters by which to rotate the string

Description

 • The Rotate(s, offset) command rotates a string s by the number of characters given in offset. The value of offset can be positive, negative, or zero. If the value of offset is zero, the original string is returned unchanged.
 • All of the StringTools package commands treat strings as (null-terminated) sequences of $8$-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Rotate}\left("abcde",2\right)$
 ${"deabc"}$ (1)
 > $\mathrm{Rotate}\left("abcde",22\right)$
 ${"deabc"}$ (2)
 > $\mathrm{Rotate}\left("abcde",-2\right)$
 ${"deabc"}$ (3)
 > $\mathrm{Rotate}\left("abcde",0\right)$
 ${"abcde"}$ (4)
 > $\left\{\mathrm{seq}\right\}\left(\mathrm{Rotate}\left("abcde",i\right),i=-100..100\right)$
 $\left\{{"abcde"}{,}{"bcdea"}{,}{"cdeab"}{,}{"deabc"}{,}{"eabcd"}\right\}$ (5)