stringObj.replace(rgExp, replaceText)ArgumentsstringObj
Required. The String object or string literal on which to perform the replacement. This string is not modified by the replace method. rgExp
Required. An instance of a Regular Expression object containing the regular expression pattern and applicable flags. Can also be a String object or literal. If rgExp is not an instance of a Regular Expression object, it is converted to a string, and an exact search is made for the results; no attempt is made to convert the string into a regular expression. replaceText
Required. A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. In JScript 5.5 or later, the replaceText argument can also be a function that returns the replacement text.
Required. The String object or string literal on which to perform the replacement. This string is not modified by the replace method. rgExp
Required. An instance of a Regular Expression object containing the regular expression pattern and applicable flags. Can also be a String object or literal. If rgExp is not an instance of a Regular Expression object, it is converted to a string, and an exact search is made for the results; no attempt is made to convert the string into a regular expression. replaceText
Required. A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. In JScript 5.5 or later, the replaceText argument can also be a function that returns the replacement text.
解决方案 »
- 原生js如何获取#hello input[name=aa[]]数组集?
- 在js文件里引入其他js文件问题,谢谢!
- JQuery指定区域的单击事件
- >>>>>>>>>>>>>想找个英语在线朗读的解决方案>>>>>>>>>>>>>>
- 新手求助>
- 谁能帮我详解一下,window.open打开新页面时出现的怪现象?
- cell.style.width 和cell.width的区别
- 这样的JS为什么不会执行?
- 怎样判断一个窗口是弹出窗口(就是用window.open打开的),还是一般的链接过来的?
- javascript的函数中形参共有多少种
- 请问在网页中如何实现当鼠标指向链接的字体时,链接的字体变色且背景色不变。
- 如何在两个网页之间传值?
var stringA = "abcdefg";
var stringB = stringA.replace("abc","0");
alert(stringA + "\n" + stringB);