StringTools
Exchange
exchange two characters in a string
Calling Sequence
Parameters
Description
Examples
Exchange( s, m, n )
s
-
Maple string
m
positive integer
n
The Exchange( s, m, n ) command exchanges characters m and n in the string s. The integers m and n must satisfy 1≤m,n≤length⁡s.
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:
Exchange⁡abc,1,2
bac
Exchange⁡abc,1,3
cba
Exchange⁡abc,3,3
abc
See Also
string
StringTools[Permute]
Download Help Document