Home > Web Front-end > JS Tutorial > body text

The sword points to offer 1, enter a string, and replace the spaces in the string with %20

PHP中文网
Release: 2017-07-07 18:10:24
Original
1690 people have browsed it

Sword refers to offer 1, enter a string, replace the spaces in the string with %20

function replaceSpace(str){
return str.replace(/\s/g,"%20");
}
replaceSpace("we are right")

The above is the detailed content of The sword points to offer 1, enter a string, and replace the spaces in the string with %20. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!