正则替换全部的 ‘ / ’

用正则表达式
var a="a/b/c/d";
console.log(a.replace(/\//g,'-'));正则表达式

结果:a-b-c-dconsole

相关文章
相关标签/搜索