Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #capitalize #letter #string #javascript
ADD COMMENT
Topic
Name
4+6 =