Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage

Scanning for a substring in Icon

Tech Computer Center logo

If you want to know whether a particular target string t occurs anywhere within a string s, use the function

    find ( t, s )

For example, the expression

    find ( "honest", "politician" )
fails, while the expression
    every write ( find ( "y", "syzygy" ) ) );
writes three lines containing the numbers 2, 4, and 6 (the positions of ``y'' characters within the string "syzygy").
Next: Implicit scanning in Icon
See also: Using strings in Icon
Previous: Checking for an initial substring in Icon
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman,
Last updated: 1998/02/08 23:14:55 UT
QR two-dimensional bar code