javascript - Removing backslashes in a string - Stack Overflow

Here is my string, tel:\99999999999. Everytime I try to open it, it es with a single back slash like

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(/^.*[\\\/]/, '')

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745654592a4638467.html

相关推荐

  • javascript - Removing backslashes in a string - Stack Overflow

    Here is my string, tel:\99999999999. Everytime I try to open it, it es with a single back slash like

    22天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信