This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Concept: split the string with the word or character you want to remove | |
// and join the parts with the word or character you want to replace with | |
var someString = "spam spam spam spam spam spam spam and some more spam"; | |
var newString = someString.split('spam').join('javascript'); // "javascript javascript javascript javascript javascript javascript javascript and some more javascript" |