Nodejs String Capitalize Capitalize()

Here you can find the source of Capitalize()

Method Source Code

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

Related

  1. Capitalize()
    String.prototype.Capitalize = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    String.prototype.CapitalizeAll = function() {
        return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});    
    
  2. capitalise()
    String.prototype.capitalise = function() {
      return this.charAt(0).toUpperCase() + this.slice(1);
    
  3. capitalise()
    String.prototype.capitalise = function() {
      return this.charAt(0).toUpperCase() + this.slice(1)
    String.prototype.capitalize = String.prototype.capitalise
    
  4. capitalise()
    String.prototype.capitalise = function() {
      return this.replace(this.substr(0,1),this.substr(0,1).toUpperCase());