News flash: I'm going to Australia in February, so this Web site may be switched off at any time.


Describing sets of characters (csets) in Icon

Before we look at Icon's functions for analyzing strings, we must first understand the idea of the cset, which is a basic Icon type that describes sets of characters.

Csets are for describing generic types of characters, such as ``letters,'' ``digits,'' and ``punctuation marks.'' Mathematically, a cset is a subset of the external character set (such as ASCII).

For example, suppose we want to talk about ``delimiter'' characters, where a delimiter is either a period, comma, or slash. This Icon statement would define a variable called delim as this cset:

    delim  :=  '.,/';
Characters written between single quotes ('') define a cset. A number of csets are predefined in Icon:
Next: Analyzing strings with Icon
See also: Using the Icon programming language
Previous: Selecting a substring in Icon

John W. Shipman, john@nmt.edu