A site for testing the new tools I'm building, and a little talk about what I'm learning on the way.
Monday, December 28, 2009
var str = "Please change all the change words in this sentence.";
var searchfor = "change";
str = str.replace(new RegExp(searchfor, 'g'), "changed");
The resulting value for str would be:
"Please changed all the changed words in this sentence.";