home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / strings / string < prev    next >
Encoding:
Text File  |  1992-12-17  |  5.3 KB  |  105 lines

  1.           string option arg ?arg ...?
  2.                Perform one of several string operations, depending  on
  3.                option.   The  legal options (which may be abbreviated)
  4.                are:
  5.  
  6.                string compare string1 string2
  7.                     Perform  a  character-by-character  comparison  of
  8.                     strings string1 and string2 in the same way as the
  9.                     C strcmp procedure.  Return -1, 0, or 1, depending
  10.                     on whether string1 is lexicographically less than,
  11.                     equal to, or greater than string2.
  12.  
  13.                string first string1 string2
  14.                     Search string2 for a sequence of  characters  that
  15.                     exactly  match  the  characters  in  string1.   If
  16.                     found, return the index of the first character  in
  17.                     the  first  such  match  within  string2.   If not
  18.                     found, return -1.
  19.  
  20.                string index string charIndex
  21.                     Returns  the  charIndex'th character of the string
  22.                     argument.  A charIndex of  0  corresponds  to  the
  23.                     first  character  of  the string.  If charIndex is
  24.                     less than 0 or greater than or equal to the length
  25.                     of the string then an empty string is returned.
  26.  
  27.                string last string1 string2
  28.                     Search string2 for a sequence of  characters  that
  29.                     exactly  match  the  characters  in  string1.   If
  30.                     found, return the index of the first character  in
  31.                     the  last  such match within string2.  If there is
  32.                     no match, then return -1.
  33.  
  34.                string length string
  35.                     Returns  a  decimal  string  giving  the number of
  36.                     characters in string.
  37.  
  38.                string match pattern string
  39.                     See if pattern matches  string;  return  1  if  it
  40.                     does,  0  if  it  doesn't.   Matching is done in a
  41.                     fashion similar to that used by the C-shell.   For
  42.                     the  two  strings to match, their contents must be
  43.                     identical  except  that  the   following   special
  44.                     sequences may appear in pattern:
  45.  
  46.                     *         Matches any sequence  of  characters  in
  47.                               string, including a null string.
  48.  
  49.                     ?         Matches any single character in string.
  50.  
  51.                     [chars]   Matches any character in the  set  given
  52.                               by chars.  If a sequence of the form x-y
  53.                               appears in  chars,  then  any  character
  54.                               between x and y, inclusive, will match.
  55.  
  56.                     \x        Matches the single  character  x.   This
  57.                               provides  a  way of avoiding the special
  58.                               interpretation of the  characters  *?[]\
  59.                               in pattern.
  60.  
  61.                string range string first last
  62.                     Returns  a  range  of  consecutive characters from
  63.                     string, starting with the character whose index is
  64.                     first and ending with the character whose index is
  65.                     last.  An index of 0 refers to the first character
  66.                     of   the   string.    Last  may  be  end  (or  any
  67.                     abbreviation of it) to refer to the last character
  68.                     of the string.  If first is less than zero then it
  69.                     is treated as if it were  zero,  and  if  last  is
  70.                     greater  than or equal to the length of the string
  71.                     then it is treated as if it were end.  If first is
  72.                     greater   than   last  then  an  empty  string  is
  73.                     returned.
  74.  
  75.                string tolower string
  76.                     Returns  a  value  equal to string except that all
  77.                     upper case letters have been  converted  to  lower
  78.                     case.
  79.  
  80.                string toupper string
  81.                     Returns  a  value  equal to string except that all
  82.                     lower case letters have been  converted  to  upper
  83.                     case.
  84.  
  85.                string trim string ?chars?
  86.                     Returns  a  value  equal to string except that any
  87.                     leading or trailing characters from the set  given
  88.                     by  chars  are removed.  If chars is not specified
  89.                     then  white  space  is  removed   (spaces,   tabs,
  90.                     newlines, and carriage returns).
  91.  
  92.                string trimleft string ?chars?
  93.                     Returns  a  value  equal to string except that any
  94.                     leading characters from the set given by chars are
  95.                     removed.   If  chars  is  not specified then white
  96.                     space is  removed  (spaces,  tabs,  newlines,  and
  97.                     carriage returns).
  98.  
  99.                string trimright string ?chars?
  100.                     Returns  a  value  equal to string except that any
  101.                     trailing characters from the set  given  by  chars
  102.                     are removed.  If chars is not specified then white
  103.                     space is  removed  (spaces,  tabs,  newlines,  and
  104.                     carriage returns).
  105.