Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript replace tag

String.prototype.replace()
The replace() method returns a new string with some or all matches of a pattern replaced by a replacement.
The pattern can be a string or a RegExp, and the replacement can be a string or a function called for each match. 
If pattern is a string, only the first occurrence will be replaced.
// example
var str = "JavaScript replace method test";
var res = str.replace("test", "success"); 
 
PREVIOUS NEXT
Tagged: #javascript #replace #tag
ADD COMMENT
Topic
Name
1+1 =