开发者

How can I match '&' with JS RegExp

开发者 https://www.devze.com 2023-01-04 19:06 出处:网络
I have a开发者_如何学编程n url-encoded url (so with & replaced to &), but I want to replace all the occurences of & back to & using javascript. Currently I\'m using myStr.repla

I have a开发者_如何学编程n url-encoded url (so with & replaced to &), but I want to replace all the occurences of & back to & using javascript. Currently I'm using myStr.replace("/&/g", "&"), but that doesn't work (replaces nothing).

Thanks,

Lex


myStr.replace(/&/g, "&")
0

精彩评论

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