first letter tuUppercase
//capitalize only the first letter of the string.
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
//capitalize all words of a string.
function capitalizeWords(string) {
return string.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
};function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
console.log(capitalizeFirstLetter('foo bar bag')); // Fooconst lower = 'this is an entirely lowercase string';
const upper = lower.charAt(0).toUpperCase() + lower.substring(1);const string = "tHIS STRING'S CAPITALISATION WILL BE FIXED."
const string = string.charAt(0).toUpperCase() + string.slice(1)const string = "tHIS STRING'S CAPITALISATION WILL BE FIXED."
const string = string[0].toUpperCase() + string.slice(1)
Also in JavaScript:
- javascript how to get the last character of a string
- print array without brackets javascript
- is knex built into node js
- the path argument must be of type string. received undefined react
- javascript array find highest value of array of objects by key
- No matching version found for swagger-jsdoc@^6.0.0.
- select a form by name jquery
- typescript vs javascript
- count number of each element in array javascript
- jquery addeventlistener
- javascript modal close
- javascript read database
- node js send fcm
- How find a specific character in js
- drupal 8 get url from node entity
- javascript remove spaces at the beginning of the end of the string
- modulus js
- typescript read json file
- node js ffmpeg image to video
- comprimento string javascript
- form in react
- lodash pascal case
- convert string to array js
- checkbox jquery checked