Definition: | string text = substitute_all(string text, sequence strings, sequence replacements) |
Description: | Replace all instances of each string in strings in text with the corresponding string in replacements. |
Comments: | A simple wrapper to substitute, allowing multiple strings to be substituted in one call. |
Example 1: |
constant {hchars,hsubs} = columnize({{"<","<"}, {">",">"}, {"&","&"}, {"\"","""}, {"\'","'"}}) function xmlquote(string s) return substitute_all(s,hchars,hsubs) end function |
Example 2: | You can also use a pair of strings for simple letter subsitution. |
?substitute_all("One fine day in the middle of the night.","aeiou","AEIOU") -- displays "OnE fInE dAy In thE mIddlE Of thE nIght." |
|
See Also: | join, tagset |