home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
tcl_447.lzh
/
TCL
/
tcl.lzh
/
tcl
/
help
/
string
< prev
next >
Wrap
Text File
|
1990-05-03
|
2KB
|
54 lines
string option a b
Perform a string operation on the two operands a and b,
based on option. The possible options are:
string compare a b
Perform a character-by-character comparison of
strings a and b, in the same way as the C strcmp
procedure. Return -1, 0, or 1, depending on
whether a is lexicographically less than, equal
to, or greater than b.
string first a b
Search b for a sequence of characters that exactly
match the characters in a. If found, return the
index of the first character in the first such
match within b. If not found, return -1.
string last a b
Search b for a sequence of characters that exactly
match the characters in a. If found, return the
index of the first character in the last such
match within b. If there is no match, then return
-1.
string match pattern string
See if pattern matches string; return 1 if it
does, 0 if it doesn't. Matching is done in a
fashion similar to that used by the C-shell. For
the two strings to match, their contents must be
identical except that the following special
sequences may appear in pattern:
*
Matches any sequence of characters in
string, including a null string.
?
Matches any single character in string.
[chars]
Matches any character in the set given
by chars. If a sequence of the form x-y
appears in chars, then any character
between x and y, inclusive, will match.
\x
Matches the single character x. This
provides a way of avoiding the special
interpretation of the characters *?[]\
in pattern.
Unique abbreviations for option are acceptable.