js去掉字符串中的特殊字符,采用replace()

/去掉逗号和引号/
var name =“你好多,世界”
var name = name.replace(/["|’|,|\“|\”|\,]/g,"");
就可以了

发布了21 篇原创文章 · 获赞 0 · 访问量 207

猜你喜欢

转载自blog.csdn.net/qq_35315439/article/details/104766668