Answers for "javascript to lowercase except first letter"

1

javascript string first letter lowercase

// for lowercase on first letter
let s = "This is my string"
let lowerCaseFirst = s.charAt(0).toLowerCase() + s.slice(1)
Posted by: Guest on January-11-2021
0

javascript lowercase string except first letter of every word if there are ''

var text = "foo bar 'loo' zoo moo";
text = text.toLowerCase().split(' ').map((s) => { if(s.charAt(0)!=="'") return s.charAt(0).toUpperCase() + s.substring(1)
      else return s.charAt(0)+s.charAt(1).toUpperCase() + s.substring(2)}).join(' ');
//text = "Foo Bar 'Loo' Zoo Moo"
Posted by: Guest on September-10-2021

Code answers related to "javascript to lowercase except first letter"

Code answers related to "Javascript"

Browse Popular Code Answers by Language