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

Finding the size of an Icon string

Tech Computer Center logo

The unary ``*'' operator, applied to a string, returns the number of characters in the string. For example, the expression

    * "foo"
yields the integer 3, the number of characters in the string "foo".

Here's another example. This program prints the length of every line of its input:

    procedure main()
      while  line := read ( )  do
        write ( * line );
    end

Next: Selecting a substring in Icon
See also: Using strings in Icon
Previous: How Icon positions are numbered
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, john@nmt.edu
Last updated: 1996/01/06 21:12:57 UT
URL: http://www.nmt.edu/tcc/help/lang/icon/stringsize.html
QR two-dimensional bar code