Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
string.replace(regexp, replacement)
regexp
The RegExp object that specifies the pattern to be replaced. If this argument is a string, it is used as a literal text pattern to be searched for; it is not first converted to a RegExp object.
replacement
A string that specifies the replacement text, or a function that is invoked to generate the replacement text. See the Description section for details.
A new string, with the first match, or all matches, of regexp replaced with replacement.