replaceMany()

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

This function is valid in v2.16.0 to v2.17.1. This function has been downloaded 8 times.

Parameters

{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 negative it indicates how many occurrences of target from the end to not replace. If not specified all occurrences will be replaced.

Returns

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