Nodejs Utililty Methods String Camel Case

List of utility methods to do String Camel Case

Description

The list of methods to do String Camel Case are organized into topic(s).

Method

toCamelCase()
String.prototype.toCamelCase = function(){
  return this
         .toLowerCase()
         .replace(/(\s+[a-z])/g, 
            function($1) {
              return $1.toUpperCase().replace(' ', '');
          );
toCamelCase()
String.prototype.toCamelCase = function () {
    return this.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (match, index) {
        if (+match === 0) return ""; 
        return index == 0 ? match.toLowerCase() : match.toUpperCase();
    });
};
toCamelCase()
String.prototype.toCamelCase = function() {
    var parts = this.split('-'),
        rtr = "",
        part;
    for (var i = 0; i < parts.length; i++) {
        part = parts[i];
        rtr += (i === 0) ? part.toLowerCase() : part[0].toUpperCase()+part.slice(1).toLowerCase();
    return rtr;
...
toCamelCase()
String.prototype.toCamelCase = function() {
  return this.replace(/-([a-z])/g, function (m, w) {
    return w.toUpperCase();
  });
toCamelCase()
String.prototype.toCamelCase = function() {
  return this.replace(/(^|\s)[a-z]/g, function (x) { return x.toUpperCase() });
toCamelCase()
String.prototype.toCamelCase = function() {
    return this.toLowerCase()
        .replace(/[-_]+/g, ' ')
        .replace(/[^\w\s]/g, '')
        .replace(/ (.)/g, function($1) {
            return $1.toUpperCase();
        })
        .replace(/ /g, '');
};
...
toCamelCase()
String.prototype.toCamelCase = function () {
    return this.charAt(0).toLowerCase() + this.slice(1);
};
toCamelCase()
String.prototype.toCamelCase = function() {
  words = this.split(' ')
  var upperCased = '';
  for (var i = 0; i < words.length; i++) {
    for (var y = 0; y < words[i].length; y++) {
      if (y == 0) {
        upperCased += words[i][y].toUpperCase();
      else {
...
toCamelCase()
String.prototype.toCamelCase = function(){
    return this.replace(/(\_[a-z])/g, function($1){return $1.toUpperCase().replace('_','');});
};
toCamelCase()
String.prototype.toCamelCase = function() {
  return this
          .replace(/([\-_\.][a-z])/g, ($1) => {
            return $1.toUpperCase().replace('-','');
          });
};