Here you can find the source of snakeCaseDash()
String.prototype.snakeCaseDash = function() { return this.replace( /([A-Z])/g, function( $1 ) {return "-" + $1.toLowerCase();} ); };
String.prototype.toAlternatingCase = function () { var result = []; var letters = this.split(""); letters.forEach(function(char) { if ((char.charCodeAt(0) >= 97) && (char.charCodeAt(0) <= 122)) { result.push(char.toUpperCase()); } else if ((char.charCodeAt(0) >= 65) && (char.charCodeAt(0) <= 90)){ result.push(char.toLowerCase()); } else { ...
String.prototype.toAlternatingCase = function () { var newStr = ""; for (var i = 0; i < this.length; i++){ if (this.charAt(i).toUpperCase() === this.charAt(i)){ newStr += this.charAt(i).toLowerCase(); } else { newStr += this.charAt(i).toUpperCase(); return newStr;
String.prototype.toAlternatingCase = function () { return this.toString().split('') .map(l => l.match(/[a-z]/) ? l.toUpperCase() : l.toLowerCase()) .join('');
String.prototype.toAlternatingCase = function() { var output = ''; for (var i=0; i<this.length; i++) { if (this[i].toLowerCase() === this[i]) { output = output + this[i].toUpperCase(); } else if (this[i].toUpperCase() === this[i]) { output = output + this[i].toLowerCase(); } else { output = output + this[i]; ...
String.prototype.snakeCase = function() { return this.replace( /([A-Z])/g, function( $1 ) {return "_" + $1.toLowerCase();} ); };
String.prototype.snake_case = function(){ return this .replace( /[A-Z]/g, function($1) { return '_' + $1 } ) .toLowerCase();
String.prototype.toSnakeCase = function(){ return this.replace(/([A-Z])/g, function($1){return "_"+$1.toLowerCase();}); };
String.prototype.toCap = function () { var result = this.toUpperCase().charAt(0) + this.slice(1, this.length); return result; };
String.prototype.toCap = function() { var string = this.toString(); if(!string.length) return; var lastName = string.split(' ').pop(); var firstName = string.split(' ')[0]; lastName = lastName[0].toUpperCase() + lastName.slice(1); firstName = firstName[0].toUpperCase() + firstName.slice(1); string = firstName + " " + lastName; return string; ...