+ 1
What function do you use to replace all letters?
I used “Hay!”.replace(“a”,”e”) But if I added more, it would only replace first a. Can you figure out a method/function to replace or “a”’s
3 Answers
+ 3
"Hay!".replace(/a/g, "e")
+ 2
Use escape character "\"
"Dami's brother says hi".replace(/\'/g, "‘")
0
How would you replace characters like this? (“ and ‘ and ` )
Would you use this?
“Dami’s brother says hi”.replace(/‘ ‘/g,””)?