Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Title Case a Sentence-Javascript

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