正则替换所有的 ‘ / ’

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

结果:a-b-c-d

原文地址:https://www.cnblogs.com/mary-123/p/11758914.html