News flash: I'm going to Australia in February, so this Web site may be switched off at any time.
Checking the first character of an Icon string
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
describing csets of
characters (csets) 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
value 1.
- If the first character of s is not
in the cset c, the ``
any()
'' function fails.
Next:
Checking initial string characters in Icon
See also:
Using the Icon programming language
Previous:
Analyzing strings with Icon
John W. Shipman, john@nmt.edu