Every line of 'tocapitalize js' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
28 function uncapitalize(str) { 29 return (str.charAt(0).toLowerCase() + str.slice(1)); 30 }
7 function capitalize(str) { 8 return str && str[0].toUpperCase() + str.slice(1); 9 }
145 function capitalize(string) { 146 return string.replace(/^[a-z]/, function(str) { 147 return str.toUpperCase(); 148 }); 149 }
21 export function capitalize(str) { 22 return ucFirst(str); 23 }
1 export default function capitalize(str) { 2 return str.replace(/\b\w/g, function (l) { 3 return l.toUpperCase() 4 }); 5 }
63 function capitalize(str) { 64 return str.replace(/^[a-z]/, char => char.toUpperCase()); 65 }
1 export default function capitalize(str: string) { 2 return `${str.slice(0, 1).toUpperCase()}${str.slice(1)}`; 3 }
2 function capitalize (str) { 3 // spit the string to array 4 let wordArr = str.split(' '); 5 6 // loop through each element of array and capitalize the first letter 7 8 for (let i=0; i
7 export function capitalize (string) { 8 return string && (string.charAt(0).toUpperCase() + string.slice(1)) 9 }
22 function _capitalize(string) { 23 return string && (string.charAt(0).toUpperCase() + string.slice(1)); 24 }