replace 方法.
或者用string的函数,建议楼主下载一个script56.chm.

解决方案 »

  1.   

    stringObj.replace(rgExp, replaceText)Arguments
    stringObj 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.
      

  2.   

    rgExp为正则表达式,也可为字符串。
    string1 = "haha lo";
    string1.replace("ha","pa");
    //now string1 is "papa lo"
      

  3.   

    var str="abcdefg";
    document.write(str.replace("cd","kkk"));
      

  4.   

    relace只能替换从左向右遇到的第一个子串
      

  5.   

    能不能script56.chm的下载地址?网上搜的好像都不能下载 。