(m4.info.gz) Index macro
Info Catalog
(m4.info.gz) Len
(m4.info.gz) Text handling
(m4.info.gz) Regexp
10.2 Searching for substrings
=============================
Searching for substrings is done with `index':
-- Builtin: index (STRING, SUBSTRING)
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'.
The macro `index' is recognized only with parameters.
index(`gnus, gnats, and armadillos', `nat')
=>7
index(`gnus, gnats, and armadillos', `dag')
=>-1
Omitting SUBSTRING evokes a warning, but still produces output.
index(`abc')
error-->m4:stdin:1: Warning: too few arguments to builtin `index'
=>0
Info Catalog
(m4.info.gz) Len
(m4.info.gz) Text handling
(m4.info.gz) Regexp
automatically generated byinfo2html