Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

string.replace javascript

//Replace the first match in a string
//If you wish to replace all matches, use the replaceAll() method.

var str = "JavaScript replace method test";
var res = str.replace("test", "success");  
//res = Javscript replace method success
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
3+6 =