Title Case a Sentence-Javascript

73

Title Case a Sentence-Javascript -

function titleCase(str) {
  return str.toLowerCase().replace(/(^|\s)\S/g, L => L.toUpperCase());
}

Comments

Submit
0 Comments