Answers for "to string case javascript"

89

javascript lowercase string

var str = "My Big Boy!"
var res = str.toLowerCase(); //res is "my big boy!"
Posted by: Guest on July-16-2019
6

string to title case javascript

function titleCase(sentence) {
  let sentence = string.toLowerCase().split(" ");
  for (let i = 0; i < sentence.length; i++) {
    sentence[i] = sentence[i][0].toUpperCase() + sentence[i].slice(1);
  }
  
  return sentence.join(" ");
}
Posted by: Guest on April-10-2020

Code answers related to "to string case javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language