replace: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Applied Template:MacroFunction) |
Verisimilar (talk | contribs) m (Macros:Functions:replace moved to replace) |
(No difference)
|
Revision as of 03:21, 9 March 2009
replace() Function
Returns the string with the occurrences of a pattern replaced by the specified value. If the number of times to perform the replacement is not specified then all occurrences of the pattern are replaced. Pattern can be a regular expression.
Usage
[h: newStr = replace(str, pattern, value)]
[h: newStr = replace(str, pattern, value, times)]
Example
[r: replace("This is a test", " ", "-")]
[r: replace("This is a test", " ", "-", 2)]
Returns
This-is-a-testThis-is-a test