GNU Info

Info Node: (m4.info)Index

(m4.info)Index


Next: Regexp Prev: Len Up: Text handling
Enter node , (file) or (file)node

Searching for substrings
========================

   Searching for substrings is done with `index':

     index(STRING, SUBSTRING)

which expands to the index of the first occurrence of SUBSTRING in
STRING.  The first character in STRING has index 0.  If SUBSTRING does
not occur in STRING, `index' expands to `-1'.

     index(`gnus, gnats, and armadillos', `nat')
     =>7
     index(`gnus, gnats, and armadillos', `dag')
     =>-1

   The builtin macro `index' is recognized only when given arguments.


automatically generated by info2www version 1.2.2.9