Substitutes substrings with different strings. Similar to doing multiple replacements while making sure that none of the replacements overlap.
This function is valid in
v2.24.0 to v2.24.2.
This function has been downloaded 8 times.
The string with substrings that may be translated to new substrings. If
undefined the value returned from
translate() will be a partial function which will only accept the
string to be translated.
If this is an array then it must be an array of arrays where the first item in each sub-array is either a regular expression or a string indicating the substring to be found and the second item must specify the replacement. If this is an object then each key indicates the substring to be found and the value specifies the replacement. If the replacement is ever a function then it will be called with the first argument being the substring found and any subsequent arguments only be passed if there were any capture groups specified.
true then the shortest translation targets will be preferred over the longer ones. Otherwise the longest translation targets will be preferred over the shorter ones.
A new version of
string with all of the
translations carried out as defined.
This function directly requires the following functions which are included automatically:
Gets all of the matches found when matching a regular expression against a string.
Gets the native type name of a primitive or an object. Unlike YourJS.typeOf(), the types are solely determined by the system.