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
Vyacheslav Borodin -
Shafayet Hossain -
Gaurav Adhikari -
邱敬幃 Pardn Chiu -
Top comments (2)
I assume that the first
STRING_ONE
is a variable contains another string.PS: Make sure to double escape the
\
characters inSTRING_ONE
as 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.