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
Mai Chi Bao -
Md. Fahim Bin Amin -
nnamdi nwaocha -
Sushant Gaurav -
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.