replace
Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring.
See also matches.
Syntax
replace(regex, text)
Parameter |
Description |
---|---|
|
The regular expression to be searched for. |
|
The string that replaces the matched substring. |
Examples
$('VarName').replace(/yes/, '1')