I have a string variable var str = 'this is eeeeeeee';. I want to replace each letter e in this string. When I do str.replace('e', 'E'); it does it only to the first e
I have a string variable var str = ‘this is eeeeeeee’; . I want
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use regular expressions to indicate you want to replace more than one instance. In this case you would use the
gflag.More info can be found at replace – MDN