Nodejs String to Upper Case upperFirstLetter()

Here you can find the source of upperFirstLetter()

Method Source Code

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

Related

  1. upWord()
    String.prototype.upWord = function (){
      var words = this.split(" ");
      var newWords = words.map(function(elem,index) {
        return (elem[0].toUpperCase() + elem.slice(1));
      })
      return newWords.join(" ");
    var str = "the quick fox jump over the lazy dog";
    console.log(str.upWord());
    ...
    
  2. upcase()
    String.prototype.upcase = function () {
      return this.valueOf().toUpperCase();
    };
    
  3. upcase()
    String.prototype.upcase = function(){
        return this.toUpperCase();
    };
    
  4. upperCaseFirst()
    String.prototype.upperCaseFirst = function() {
      return this.replace(/^./, function(a) {
        return a.toUpperCase();
      });
    };
    
  5. upperFirstChar()
    String.prototype.upperFirstChar = function() {
      return this.charAt(0).toUpperCase() + this.slice(1)
    
  6. upperInitial()
    String.prototype.upperInitial = function() {
      return this.replace(/(^|\s+)\w/g, function(s) {
        return s.toUpperCase();
      });
    };
    
  7. uppercase()
    String.prototype.uppercase = function() { return this.toUpperCase() };
    
  8. uppercaseFirstLetter()
    String.prototype.uppercaseFirstLetter = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    };