Home > Web Front-end > JS Tutorial > The string replacement function replace() method in javascript is a little different from c# and vb replacement_javascript skills

The string replacement function replace() method in javascript is a little different from c# and vb replacement_javascript skills

WBOY
Release: 2016-05-16 18:24:35
Original
1189 people have browsed it

1.

Result: Only the first character a of the string is replaced. This is not the result I want↓


2.replace() supports regular expressions, it can be as follows Regular expression rules match characters or strings and then give replacement!

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