js replace替换全部字符串

replace使用正则表达式
···
"aa".replace("a",'b')
"ba"
"aa".replace(/a/g,'b')
"bb"
···

你可能感兴趣的:(js replace替换全部字符串)