Posts by Canastro • 271 points
1 post
-
17
votes8
answers34672
viewsA: Convert every first letter of every word into uppercase
An alternative: var teste = "this IS just A tExT"; teste = teste.toLowerCase().replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); console.log(teste); Explanation: First convert the…
javascriptanswered Canastro 271