Javascript String camelCaseToNormalText()

Description

Javascript String camelCaseToNormalText()


'use strict';/*from  w ww . ja v a 2 s.c  o m*/

String.prototype.camelCaseToNormalText = function () {
 return this.replace(/([A-Z])/g, ' $1').replace(/^./, function (str) {
  return str.toUpperCase();
 });
};



PreviousNext

Related