ctype ?-failindex var? class string
ctype determines whether all characters in string
are of the specified class. It returns 1 if they
are all of class, and 0 if they are not, or if the
string is empty. This command also provides
another method (besides format and scan) of con-
verting between an ASCII character and its numeric
value. The following ctype commands are available:
ctype ?-failindex var? alnum string
Tests that all characters are alphabetic or
numeric characters as defined by the character
set.
ctype ?-failindex var? alpha string
Tests that all characters are alphabetic char-
acters as defined by the character set.
ctype ?-failindex var? ascii string
Tests that all characters are an ASCII charac-
ter (a non-negative number less than 0200).
ctype char number
Converts the numeric value, string, to an
ASCII character. Number must be in the range
0 through 255.
ctype ?-failindex var? cntrl string
Tests that all characters are ``control char-
acters'' as defined by the character set.
ctype ?-failindex var? digit string
Tests that all characters are valid decimal
digits, i.e. 0 through 9.
ctype ?-failindex var? graph string
Tests that all characters within are any char-
acter for which ctype print is true, except
for space characters.
ctype ?-failindex var? lower string
Tests that all characters are lowercase let-
ters as defined by the character set.
ctype ord character
Convert a character into its decimal numeric
value. The first character of the string is
converted.
ctype ?-failindex var? space string
Tests that all characters are either a space,
horizontal-tab, carriage return, newline, ver-
tical-tab, or form-feed.
ctype ?-failindex var? print string
Tests that all characters are a space or any
character for which ctype alnum or ctype punct
is true or other ``printing character'' as
defined by the character set.
ctype ?-failindex var? punct string
Tests that all characters are made up of any
of the characters other than the ones for
which alnum, cntrl, or space is true.
ctype ?-failindex var? upper string
Tests that all characters are uppercase let-
ters as defined by the character set.
ctype ?-failindex var? xdigit string
Tests that all characters are valid hexadeci-
mal digits, that is 0 through 9, a through f
or A through F.
If -failindex is specified, then the index into
string of the first character that did not match the
class is returned in var.
This command is provided by Extended Tcl.