Nodejs String Capitalize capitalizeFirstLetter()

Here you can find the source of capitalizeFirstLetter()

Method Source Code

'use strict';/*from  w  w  w .  jav a2s.c o  m*/

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

Related

  1. capitalizeEachWord()
    String.prototype.capitalizeEachWord = function () {
        return this.replace(/\w\S*/g, function(txt) {
            return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
        });
    
  2. capitalizeFirst()
    String.prototype.capitalizeFirst = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    };
    
  3. capitalizeFirst()
    String.prototype.capitalizeFirst = function(){
        return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
    };
    
  4. capitalizeFirst()
    String.prototype.capitalizeFirst = function()
      return ( this.charAt(0).toUpperCase() + this.slice(1) );
    };
    
  5. capitalizeFirstLetter()
    String.prototype.capitalizeFirstLetter = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    
  6. capitalizeFirstLetter()
    'use strict';
    module.exports = function () {
    };
    String.prototype.capitalizeFirstLetter = function() {
      return this.charAt(0).toUpperCase() + this.slice(1);
    
  7. capitalizeFirstLetter()
    "use strict";
    String.prototype.capitalizeFirstLetter = function () {
        return this.charAt(0).toUpperCase() + this.slice(1);
    };
    
  8. capitalizeFirstLetter()
    String.prototype.capitalizeFirstLetter = function () {
        return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
    };
    
  9. capitalizeFirstLetter()
    var log = function(log){
        console.log(log);
    };
    String.prototype.capitalizeFirstLetter = function() {
            return this.charAt(0).toUpperCase() + this.slice(1);
    };