开发者

Removing backslashes in a string

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜