Next
/
Previous
/ Index
/ TCC Help System
/ Publications
/ Site map
/ NM Tech homepage
Checking the first character of a string in Icon
|
|
You can check to see if a given string starts with a particular
character or type of character using the Icon function
``any ( c, s )''.
- The first argument c must be a cset (see
`Using csets to describe sets of characters in Icon').
- The second argument s is the string to be checked.
- If the first character of s is in the cset c,
the ``
any()'' function succeeds and produces the
position after the matched character, which will be 2 in this case
(the position of the second character).
- If the first character of s is not
in the cset c, the ``
any()'' function fails.
Next: Checking the initial characters of a string in Icon
See also: Using strings in Icon
Previous: Analyzing strings with Icon
Site map
Index:
Keyword index
to help pages
Help:
New Mexico Tech Computer Center: Help System
TCC Publications
Home:
About New Mexico Tech
John Shipman, john@nmt.edu
Last updated: 1996/10/29 23:55:10 UT
URL: http://www.nmt.edu/tcc/help/lang/icon/any.html