Nodejs String Capitalize ucfirst()

Here you can find the source of ucfirst()

Method Source Code

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

Related

  1. ucFirst()
    String.prototype.ucFirst = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    
  2. ucFirst()
    String.prototype.ucFirst = function(){
      return this.replace(/^\w/, function(x){
        return x.toUpperCase();
      })
    
  3. uc_first()
    String.prototype.uc_first = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    };
    
  4. ucfirst()
    String.prototype.ucfirst = function () {
        return this.charAt(0).toUpperCase() + this.slice(1);
    };
    
  5. ucfirst()
    String.prototype.ucfirst = function() {
      return this.charAt(0) + this.slice(1);
    
  6. ucfirst()
    String.prototype.ucfirst = function()
        return this.charAt(0).toUpperCase() + this.substr(1);
    };
    
  7. ucfirst()
    String.prototype.ucfirst = function() {
        return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
    
  8. ucfirst()
    String.prototype.ucfirst=function(){
      var split=this.split('');
      split[0]=split[0].toUpperCase();
      return split.join('');
    };
    
  9. ucfirst()
    String.prototype.ucfirst = function() {
      this.toLowerCase().replace(/\b([a-z])/, function(c){
        return c.toUpperCase();
      });
    };