Nodejs String Capitalize toCapitalizeCase()

Here you can find the source of toCapitalizeCase()

Method Source Code

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

Related

  1. capitalizecapitaliseFirstLetter()
    String.prototype.capitalize = function capitaliseFirstLetter() {
        return this.charAt(0).toUpperCase() + this.slice(1);
    };
    
  2. capitalizecapitalize()
    String.prototype.capitalize = function capitalize() {
      return this[0].toUpperCase() + this.slice(1);
    };
    
  3. capitalizej()
    String.prototype.capitalize  = jCube.String.capitalize  = function () {
      return this.charAt(0).toUpperCase() + this.substring(1).replace( /\s[a-z]/g, function(s){ return s.toUpperCase(); });
    
  4. capitalizingFirstLetterOfEveryWord()
    String.prototype.capitalizingFirstLetterOfEveryWord = function () {
      return this.replace(/(?:^|\s)\S/g, function(m){ return m.toUpperCase(); });
    };
    
  5. toCapitalCase( allCapsWordLength )
    var ID_DELIMITER = '-';
    function sanitizeString( input ) {
        return input.split( /\W/g )[1];
    String.prototype.toCapitalCase = function( allCapsWordLength ) {
        if ( isNaN( parseInt( allCapsWordLength ) ) ) {
            allCapsWordLength = 3;
        var words = this.split(' ');
    ...
    
  6. ucFirst()
    String.prototype.ucFirst = function() {
        var str = this;
        if(str.length) {
            str = str.charAt(0).toUpperCase() + str.slice(1);
        return str;
    };
    
  7. ucFirst()
    String.prototype.ucFirst = function () {
      return this.charAt(0).toUpperCase() + this.slice(1);
    };
    
  8. ucFirst()
    String.prototype.ucFirst = function()
        return this.charAt(0).toUpperCase() + this.substr(1);
    
  9. ucFirst()
    String.prototype.ucFirst = function(){
        var string_array = this.split(' ')
        _.each(string_array,function(word, key){
                var word_array = word.split('')
                var fChar = word_array.shift()
                var ucFWord = fChar.toUpperCase()+word_array.join('');
                string_array[key] = ucFWord
        })
        return string_array.join(' ')
    ...