Answers for "write a function called capitalize that takes a string and returns that string with only the first letter capitalized. make sure that it can take strings that are lowercase, uppercase or both "javascript""

0

capitalize first letter of string javascript

let val = '  this is test ';
val = val.trim();
val = val.charAt(0).toUpperCase() + val.slice(1);
console.log("Value => ", val);
Posted by: Guest on September-16-2021
0

Capitalize the first letter of string using JavaScript

function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
Posted by: Guest on January-04-2022

Code answers related to "write a function called capitalize that takes a string and returns that string with only the first letter capitalized. make sure that it can take strings that are lowercase, uppercase or both "javascript""

Code answers related to "Javascript"

Browse Popular Code Answers by Language