Capitalizes given string. - Node.js String

Node.js examples for String:Case

Description

Capitalizes given string.

Demo Code


String.prototype.capitalize = function() {
    return this.charAt(0).toUpperCase() + this.slice(1);
};

Related Tutorials