JS replace

Time:2021-6-18

definition:
The replace() method is used to replace some characters in a string with others, or to replace a substring that matches a regular expression.

Grammar:

stringObject.replace(regexp/substr,replacement)
parameter describe
regexp/substr Required. Regexp object that specifies the substring or pattern to replace. Note that if the value is a string, it is used as the direct text pattern to retrieve, rather than being converted to a regexp object first.
replacement Required. A string value. Specifies the function to replace text or generate replacement text.

Return value:
A new string is usedreplacementReplace regexp’s first match or all matches.

Recommended Today

C # regular implementation of UBB parsing class code

The parsed code can pass XHTML   one   Strict verification;It includes title, link, font, alignment, picture, reference, list and other functions  Ubb.ReadMe.htm UBB code description title [H1] title I [/ H1] Title I [H2] Title II [/ H2] Title II [H1] Title III [/ H1] Title III [H4] Title IV [/ H4] Title IV […]