para o caso de capital JavaScript
const toCapitalCase = (string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
};
David Diamant
const toCapitalCase = (string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
};
const string = "tHIS STRING'S CAPITALISATION WILL BE FIXED."
const string = string.charAt(0).toUpperCase() + string.slice(1)
function toTitles(s){ return s.replace(/\w\S*/g, function(t) { return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase(); }); }
var str = toTitles('abraham lincoln'); // Abraham Lincoln