admin管理员组文章数量:1026925
Here is my string, tel:\\99999999999
. Everytime I try to open it, it es with a single back slash like \99999999999
.
How do I remove both the back slashes so that the phone number bees 99999999999
?
Here is my string, tel:\\99999999999
. Everytime I try to open it, it es with a single back slash like \99999999999
.
How do I remove both the back slashes so that the phone number bees 99999999999
?
3 Answers
Reset to default 5var tel = 'tel:\\99999999999';
tel = tel.replace(/\\/g, '');
Here is a demo
Try:
var telString = telString.replace("tel:\\\\","");
I think this will help you
stringPath.replace(/^.*[\\\/]/, '')
Here is my string, tel:\\99999999999
. Everytime I try to open it, it es with a single back slash like \99999999999
.
How do I remove both the back slashes so that the phone number bees 99999999999
?
Here is my string, tel:\\99999999999
. Everytime I try to open it, it es with a single back slash like \99999999999
.
How do I remove both the back slashes so that the phone number bees 99999999999
?
3 Answers
Reset to default 5var tel = 'tel:\\99999999999';
tel = tel.replace(/\\/g, '');
Here is a demo
Try:
var telString = telString.replace("tel:\\\\","");
I think this will help you
stringPath.replace(/^.*[\\\/]/, '')
本文标签: javascriptRemoving backslashes in a stringStack Overflow
版权声明:本文标题:javascript - Removing backslashes in a string - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745654590a2161521.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论