Created
May 7, 2020 13:45
-
-
Save StoneLabs/3d4addcce73a93c5a0474a67b978e3c0 to your computer and use it in GitHub Desktop.
JavaScript String.replaceall
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
String.prototype.replaceAll = function (search, replacement) { //String replace function | |
return this.replace(new RegExp(search, 'g'), replacement); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment