Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javaSript string first words to upper case

function titleCase(str) {
  return str.toLowerCase().replace(/(^|s)S/g, L => L.toUpperCase());
}
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #javaSript #string #words #upper #case
ADD COMMENT
Topic
Name
7+2 =