To make character or string substitutions in JS we can use the Replace () method to replace some characters with some character in a string, or to replace a substring that matches a regular expression.
Stringobject.replace (regexp/substr,replacement)
Replace with the Replace regular expression
<script language= "JavaScript1.2" >
<!--
var myString = new String ("This is a Test");
var myregexp =/is/g;
var newstring = Mystring.replace (myregexp, "Test www.111cn.net");
document.write (' Notice the last name in the original string, ' + myString ');
document.write (', was replaced and are now ' + newstring);
Document.close ();
-->
</script>
can also be replaced directly with replace
<title>using the Replace () method of the String object</title>
<script type= "text/web Effects" language= "JavaScript" >
<!--//
var originalstring = "A ab ABC abcd";
var replacedstring = "a";
var replacementstring = "Z";
var newstring = Originalstring.replace (replacedstring, replacementstring);
document.write ("-->
</script>
<body>
</body>
For Chinese we'd better use regular oh.