Hi,
How can I use strings as the 'find' in a JS regex?
i.e.:
var find = ["a", "b", "c"];
var string = "abcdefghijkl";
Now, I want to replace all the elements of the array find, with a blank string ( " "
), using regular expressions. How can I do this?
I mean, using .replace(/find[i]/g, "")
in a loop wouldn't work.
So, how can I do it?
Thanks!