日期:2014-05-16  浏览次数:20411 次

js中实现字符串的replaceAll方法

?

var str="中国、美国、日本、法国"
var num = Number(str.replace(/、/g,";"));//把str中的“、"替换为“;”。g在这里是全局的意思。