StringTools
LowerCase
change each alphabetic character in a string to lowercase
UpperCase
change each alphabetic character in a string to uppercase
OtherCase
change each alphabetic character in a string to the alternate case
Calling Sequence
Parameters
Description
Examples
LowerCase( s, rng )
UpperCase( s, rng )
OtherCase( s, rng )
s
-
Maple string
rng
(optional) integer range
The LowerCase(s) calling sequence changes each alphabetic character in the string s to lowercase and returns the result in a new string. The string s remains unchanged.
The UpperCase(s) calling sequence changes each alphabetic character in the string s to uppercase and returns the result in a new string. The string s remains unchanged.
The OtherCase(s) calling sequence changes each alphabetic character in the string s to the opposite case and returns the result in a new string. The string s remains unchanged.
See StringTools[IsLower] and StringTools[IsUpper] for definitions of lower and uppercase characters.
These commands all accept an optional, second argument rng, a range that specifies a substring of the input s to be affected by the operation. Only characters within the given range are changed.
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:
LowerCase⁡
LowerCase⁡ABC
abc
LowerCase⁡ABC;!def
abc;!def
LowerCase⁡Impedance of Free Space
impedance of free space
LowerCase⁡ABCDEFGHIJ,3..8
ABcdefghIJ
UpperCase⁡
UpperCase⁡abc
ABC
UpperCase⁡abc;!DEF
ABC;!DEF
UpperCase⁡Totally Random
TOTALLY RANDOM
UpperCase⁡abcdefghij,3..−2
abCDEFGHIJ
OtherCase⁡
OtherCase⁡abc
OtherCase⁡DEF
def
OtherCase⁡abc;DEF
ABC;def
OtherCase⁡The Higher, The Fewer!
tHE hIGHER, tHE fEWER!
Note that LowerCase and UpperCase are not mutual inverses.
s≔LowerCase⁡abcDEF
s≔abcdef
UpperCase⁡s
ABCDEF
However, LowerCase(UpperCase(Lowercase(s))) = LowerCase(s) for every s.
LowerCase⁡UpperCase⁡LowerCase⁡abcDEF
abcdef
The OtherCase command is an involution.
OtherCase⁡OtherCase⁡abcDEF
abcDEF
See Also
string
StringTools[Capitalize]
Download Help Document