Answers for "capitalize inital letter string"

32

javascript capitalize first letter

const lower = 'this is an entirely lowercase string';
const upper = lower.charAt(0).toUpperCase() + lower.substring(1);
Posted by: Guest on March-04-2020
0

how to capitalize a letter based on an index in javascript

function capitalize(s,arr){
  s = s.split("");
  for(var i = 0; i < arr.length; i++){
    if (s[arr[i]] == null) { continue }
    s[arr[i]]=s[arr[i]].toUpperCase();  
  }
  s = s.join('');
  return s;
};
Posted by: Guest on June-29-2020

Code answers related to "capitalize inital letter string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language