Javascript String toPascalCase()

Description

Javascript String toPascalCase()

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

Javascript String toPascalCase()

function checkVariable(value)
{
 return ( (value != undefined) && (value != null) );
}

String.prototype.toPascalCase = function()
{
 return this.replace(/\w+/g, function(w){return w[0].toUpperCase() + w.slice(1).toLowerCase();});
}

function thousandsSeparator(value)
{
 var str = "";
 while (value > 1000)   
 {
  var rest = value % 1000;
  var rest_str = ((rest < 100) ? ((rest < 10) ? '00': '0') : '') + rest;
  str = rest_str + ' ' + str;
  value = Math.floor(value / 1000);
 }
 
 if (value > 0)
  str = value + ' ' + str;
 
 return str;// w w  w .j  a v a  2 s  .c o  m
}

Javascript String toPascalCase()

String.prototype.toPascalCase = function () {
    var result = this.charAt(0).toUpperCase() + this.substring(1);
    result = result.replaceAll("-", "");
    return result;
};



PreviousNext

Related