Home >Web Front-end >JS Tutorial >How to replace the & character with '&:' using js_javascript skills

How to replace the & character with '&:' using js_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 19:25:031974browse

var re = /&/g;
var str = "http://www.163.com?id=333&r=999&o=000";

str.replace(re,"&");

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn