StringTools
Rotate
rotate the characters in a string by a given amount
Calling Sequence
Parameters
Description
Examples
Rotate( s, offset )
s
-
Maple string
offset
integer; number of characters by which to rotate the string
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.
with⁡StringTools:
Rotate⁡abcde,2
deabc
Rotate⁡abcde,22
Rotate⁡abcde,−2
Rotate⁡abcde,0
abcde
seq⁡Rotate⁡abcde,i,i=−100..100
abcde,bcdea,cdeab,deabc,eabcd
See Also
string
Download Help Document