Nodejs Utililty Methods String Capitalize

List of utility methods to do String Capitalize

Description

The list of methods to do String Capitalize are organized into topic(s).

Method

capitalize()
String.prototype.capitalize = function() {
    return this.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
};
capitalize()
String.prototype.capitalize = function() {
  return this[0].toUpperCase() + this.slice(1);
capitalize()
String.prototype.capitalize = function () {
  return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
capitalize()
String.prototype.capitalize = function() {
  return this.slice(0, 1).toUpperCase() + this.slice(1).toLowerCase();
};
capitalize()
String.prototype.capitalize = function () {
    'use strict';
    return this.charAt(0).toUpperCase() + this.slice(1);
};
capitalize()
String.prototype.capitalize = function () {
  return this.charAt(0).toUpperCase() + this.slice(1);
capitalize()
String.prototype.capitalize = function () {
  return this.charAt(0).toUpperCase() + this.slice(1);
capitalize()
String.prototype.capitalize = function () {
  return this ? this.charAt(0).toUpperCase() + this.slice(1) : '';
};
capitalize()
String.prototype.capitalize = function() {
  var str = this
  return str.charAt(0).toUpperCase() + str.slice(1);
capitalize()
String.prototype.capitalize = function() {
  return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
};