Created
February 1, 2018 03:42
-
-
Save victorsferreira/9ccbac66c35738fd8e08cd40f03015e9 to your computer and use it in GitHub Desktop.
Find and replace for all programming languages
This file contains 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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment