I have searched over the web can can\'t find anything to help me. I want to make the first letter of each word upper case within a variable.
So far i have tried:
var str = "HELLO WORLD HELLO WORLD HELLO WORLD HELLO WORLD"; str = str.replace( /([A-Z])([A-Z]+)/g, function (a, w1, w2) { return w1 + w2.toLowerCase(); }); alert(str);