var a = "/a/b/c"; alert(a.replace(new RegExp("/","gm"),"")); 转载于:https://www.cnblogs.com/littleCode/p/3428934.html