Skip to content

Capitalize the first letter of a string in javascript

var capitalizeMe = "capitalize the first letter of a string in javascript";

var capitalized = capitalizeMe[0].toUpperCase() + capitalizeMe.substring(1);

console.log(capitalized);

// Capitalize the first letter of a string in javascript
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments