Javascript String snakeCase()

Description

Javascript String snakeCase()


String.prototype.snakeCase = function() {
 return this.replace( /([A-Z])/g, function( $1 ) {return "_" + $1.toLowerCase();} );
};



PreviousNext

Related