gawk: String Functions

1 
1 9.1.3 String-Manipulation Functions
1 -----------------------------------
1 
1 The functions in this minor node look at or change the text of one or
1 more strings.
1 
1    'gawk' understands locales (⇒Locales) and does all string
1 processing in terms of _characters_, not _bytes_.  This distinction is
1 particularly important to understand for locales where one character may
1 be represented by multiple bytes.  Thus, for example, 'length()' returns
1 the number of characters in a string, and not the number of bytes used
1 to represent those characters.  Similarly, 'index()' works with
1 character indices, and not byte indices.
1 
1      CAUTION: A number of functions deal with indices into strings.  For
1      these functions, the first character of a string is at position
1      (index) one.  This is different from C and the languages descended
1      from it, where the first character is at position zero.  You need
1      to remember this when doing index calculations, particularly if you
1      are used to C.
1 
1    In the following list, optional parameters are enclosed in square
1 brackets ([ ]).  Several functions perform string substitution; the full
1 discussion is provided in the description of the 'sub()' function, which
1 comes toward the end, because the list is presented alphabetically.
1 
1    Those functions that are specific to 'gawk' are marked with a pound
1 Options::):
1 

Menu