Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

uppercase first letter js

function ucwords (str) {
  return (str + '').replace(/^([a-z])|s+([a-z])/g, function ($1) {
    return $1.toUpperCase();
  });
}

console.log(ucwords("hello world"));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #uppercase #letter #js
ADD COMMENT
Topic
Name
2+6 =