Last active
December 1, 2018 19:01
-
-
Save chris-sev/d1d233fb4ff5264cd50b8208a03dcf84 to your computer and use it in GitHub Desktop.
Replace All \- with -
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
const myUrl = 'this\-is\-my\-url'; | |
// myMessage.replace(/\\-/g, '-'); | |
// or | |
const newUrl = myUrl.replace(new RegExp('\-', 'g'), '-'); | |
console.log(newUrl); // this-is-my-url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment