home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / tcl_447.lzh / TCL / tcl.lzh / tcl / help / string < prev    next >
Text File  |  1990-05-03  |  2KB  |  54 lines

  1.  string option a b
  2.       Perform a string operation on the two operands a and b,
  3.       based on option.  The possible options are:
  4.  
  5.       string compare a b
  6.     Perform a character-by-character comparison of
  7.     strings a and b, in the same way as the C strcmp
  8.     procedure. Return -1, 0, or 1, depending on
  9.     whether a is lexicographically less than, equal
  10.     to, or greater than b.
  11.  
  12.       string first a b
  13.     Search b for a sequence of characters that exactly
  14.     match the characters in a. If found, return the
  15.     index of the first character in the first such
  16.     match within b.  If not found, return -1.
  17.  
  18.       string last a b
  19.     Search b for a sequence of characters that exactly
  20.     match the characters in a. If found, return the
  21.     index of the first character in the last such
  22.     match within b.  If there is no match, then return
  23.     -1.
  24.  
  25.       string match pattern string
  26.     See if pattern matches string;  return 1 if it
  27.     does, 0 if it doesn't.  Matching is done in a
  28.     fashion similar to that used by the C-shell.  For
  29.     the two strings to match, their contents must be
  30.     identical except that the following special
  31.     sequences may appear in pattern:
  32.  
  33.     *
  34.        Matches any sequence of characters in
  35.        string, including a null string.
  36.  
  37.     ?
  38.        Matches any single character in string.
  39.  
  40.     [chars]
  41.        Matches any character in the set given
  42.        by chars.  If a sequence of the form x-y
  43.        appears in chars, then any character
  44.        between x and y, inclusive, will match.
  45.  
  46.     \x
  47.        Matches the single character x.  This
  48.        provides a way of avoiding the special
  49.        interpretation of the characters *?[]\
  50.        in pattern.
  51.  
  52.       Unique abbreviations for option are acceptable.
  53.  
  54.