Nodejs String to Upper Case upperInitial()

Here you can find the source of upperInitial()

Method Source Code

String.prototype.upperInitial = function() {
   return this.replace(/(^|\s+)\w/g, function(s) {
      return s.toUpperCase();
   });/*from   www .j a v  a  2  s.c  o m*/
};

Related

  1. upcase()
    String.prototype.upcase = function () {
      return this.valueOf().toUpperCase();
    };
    
  2. upcase()
    String.prototype.upcase = function(){
        return this.toUpperCase();
    };
    
  3. upperCaseFirst()
    String.prototype.upperCaseFirst = function() {
      return this.replace(/^./, function(a) {
        return a.toUpperCase();
      });
    };
    
  4. upperFirstChar()
    String.prototype.upperFirstChar = function() {
      return this.charAt(0).toUpperCase() + this.slice(1)
    
  5. upperFirstLetter()
    String.prototype.upperFirstLetter = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    
  6. uppercase()
    String.prototype.uppercase = function() { return this.toUpperCase() };
    
  7. uppercaseFirstLetter()
    String.prototype.uppercaseFirstLetter = function() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    };