Just a simple String prototype to capitalize the first letter of the string.
1 2 3 4 5 6 7 |
/** * Capitalize the first letter of a string * usage: str.capitalize() */ String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); } |