开发者

Removing backslashes in a string

开发者 https://www.devze.com 2023-03-24 01:38 出处:网络
Here is my string, tel:\\\\99999999999. Everytime I try to open it, it comes with a single back slash like \\99999999999.

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

How do I remove both the back slashes so that the 开发者_如何学Pythonphone number becomes 99999999999?


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

精彩评论

暂无评论...
验证码 换一张
取 消