Replace multiple instances of a target string with a replacement string.

This function is valid in v2.15.0. This function has been downloaded 1 time.


{string} subject
The string to be searched and modified.
{string} target
The string to look for and replace within subject.
{string} replacement
The string to replace instances of target within subject.
{number=} opt_limit Optional, Default:Infinity
The maximum number of occurrences of target to replace. If not specified all occurrences will be replaced.


A new version of subject with a maximum of opt_limit number of occurrences of target replaced by replacement.