String JavaScript Tutorial

Syntax

string.replace(regexpression, replacestring)
The replace() method searches the string for the regular expression passed to the method.
If a match is found, the method returns a new string with that match replaced with the replacement string passed to the method.
See the reference entry for RegExp.