Shift - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


StringTools

  

Shift

  

shift the characters in a string by a given amount

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Shift( s, shift )

Parameters

s

-

Maple string

shift

-

integer; shift amount

Description

• 

The Shift( s, shift ) command shifts the characters in a string s by the amount given by shift. The value of shift can be positive, negative, or zero. If the value of shift is zero modulo 256, 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

withStringTools:

Shiftabcde,2

cdefg

(1)

Shiftabcde,258

cdefg

(2)

Shiftabcde,2

_`abc

(3)

Shiftabcde,0

abcde

(4)

seqShiftabcde,i,i=5..5

\]^_`,]^_`a,^_`ab,_`abc,`abcd,abcde,bcdef,cdefg,defgh,efghi,fghij

(5)

See Also

string

StringTools

StringTools[Encode]

StringTools[Exchange]

StringTools[Permute]

StringTools[Rotate]