摘要:
View Code <scripttype="text/javascript">//替换字符varbeginStr="visitabc,youisabc,IisABC,heisaBC";varafterStr=beginStr.replace("abc","loaf");//返回visitloaf;//alert(afterStr);//替换所有字符varreplaceAllStr=beginStr.replace(/abc/g,"loaf");//替换所有的abc;注意正则不要加引 阅读全文