Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript title string

function toTitles(s){ return s.replace(/wS*/g, function(t) { return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase(); }); }
var str = toTitles('abraham lincoln'); // Abraham Lincoln
 
PREVIOUS NEXT
Tagged: #javascript #title #string
ADD COMMENT
Topic
Name
4+7 =