replace函数

    function replaceAll(strOrg, strFind, strReplace) {
        var index = 0;
        while (strOrg.indexOf(strFind, index) != -1) {
            strOrg = strOrg.replace(strFind, strReplace);
            index = strOrg.indexOf(strFind, index);
        }
        return strOrg
    }

  

posted on 2012-09-20 11:09  老猫zl  阅读(261)  评论(0编辑  收藏  举报