StringTools
IsLower
determine if a character is lowercase
IsUpper
determine if a character is uppercase
IsAlpha
determine if a character is alphabetic
Calling Sequence
Parameters
Description
Thread Safety
Examples
IsLower(char)
IsUpper(char)
IsAlpha(char)
char
-
string; character to test
The IsLower(char) command determines whether char is a lowercase letter. A character is lowercase if it is one of the following:
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z.
If char is a lowercase letter, then IsLower returns true. Otherwise, false is returned.
The IsUpper(char) command determines whether char is an uppercase letter. A character is uppercase if it is one of the following:
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z.
If char is an uppercase letter, then IsUpper returns true. Otherwise, false is returned.
The IsAlpha(char) command determines whether char is an alphabetic character. A character is alphabetic if it is either upper or lowercase.
If char is an alphabetic character, IsAlpha returns true. Otherwise, false is returned.
For these procedures, if char is a string that contains more than one character, then all the characters in the string are tested. The procedures returns true if the condition is true of all characters in the input string. For the empty string, the tested condition is vacuously true.
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.
The StringTools[IsLower], StringTools[IsUpper] and StringTools[IsAlpha] commands are thread-safe as of Maple 15.
For more information on thread safety, see index/threadsafe.
with⁡StringTools:
s≔convert⁡`$`⁡1..255,bytes:
length⁡s
255
Select⁡IsUpper,s
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Select⁡IsLower,s
abcdefghijklmnopqrstuvwxyz
Select⁡IsAlpha,s
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
See Also
convert
length
string
StringTools[HasAlpha]
StringTools[HasLower]
StringTools[HasUpper]
StringTools[IsAlphaNumeric]
StringTools[LowerCase]
StringTools[Select]
StringTools[UpperCase]
Download Help Document