Created
January 30, 2020 16:37
-
-
Save alexandreservian/da805cc616080389492ba9c93ff2505d to your computer and use it in GitHub Desktop.
Método replace
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 text = "É só o amor, é só o amor Que conhece o que é verdade"; | |
const regex = /o\samor/gi; | |
console.log(text.replace(regex, "a dor")) | |
//É só a dor, é só a dor Que conhece o que é verdade |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment