How to call strings from json for this code?
entered_text.replace(/STRING_ONE/g,"STRING_ONE");
How to call strings from json for this code?
entered_text.replace(/STRING_ONE/g,"STRING_ONE");
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
I assume that the first
STRING_ONEis a variable contains another string.PS: Make sure to double escape the
\characters inSTRING_ONEas you are putting regex pattern from string. So, for example,^[a-z\d-]+$must be written as^[a-z\\d-]+$.STRING_TWO replace word or words from STRING_ONE
But i have too many word to replace.