How can I use a variable to remove all instances of a substring from a string?
(to remove, I\'m thinking the best way is to replace, with nothing, globally... right?)
var re = /apples/gi;
var str = 'Apples are round, and apples are juicy.';
var newstr = str.replace(re, 'oranges');
console.log(newstr); // oranges are round, and oranges are juicy.
where /gi tells it to do a global replace, ignoring case.