Avatar

Correct answer by
Level 8

I split this into multimuple lines but you could likely do it in one if you prefer

var sometext = this.rawValue;

sometext = sometext.toLowerCase();

this.rawValue = sometext.replace(/\b([a-z])/g, function (_, initial) {return initial.toUpperCase();});

View solution in original post