Next: Forbidden Patterns, Previous: Evaluation Macros, Up: Programming in M4sugar
The following macros may be used to manipulate strings in M4. They are not intended for casual use.
Backslash-escape all characters in string that are active in regexps.
Return string with letters converted to upper or lower case, respectively.
Split string into an M4 list of elements quoted by ‘[’ and ‘]’, while keeping white space at the beginning and at the end. If regexp is given, use it instead of ‘[\t ]+’ for splitting. If string is empty, the result is an empty list.
Remove leading and trailing spaces and tabs, sequences of backslash-then-newline, and replace multiple spaces and tabs with a single space.
Redefine macro-name to its former contents with separator and string added at the end. If macro-name was undefined before (but not if it was defined but empty), then no separator is added.
m4_append
can be used to grow strings, andm4_append_uniq
to grow strings without duplicating substrings.