js替换全部斜杠为“-”

js替换全部斜杠为“-”

1.js

只是用replace("/","-")并不能替换掉字符串中的所有斜杠

replace(/\//g, '-')

效果:



猜你喜欢

转载自blog.csdn.net/weixin_40687883/article/details/80499741