最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Removing backslashes in a string - Stack Overflow

programmeradmin10浏览0评论

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?

Share Improve this question edited Oct 30, 2011 at 12:12 Peter Mortensen 31.6k22 gold badges110 silver badges133 bronze badges asked Aug 1, 2011 at 11:38 John CooperJohn Cooper 7,67133 gold badges83 silver badges102 bronze badges 0
Add a ment  | 

3 Answers 3

Reset to default 5
var 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(/^.*[\\\/]/, '')
发布评论

评论列表(0)

  1. 暂无评论