Camel Case To Normal Text - Node.js String

Node.js examples for String:Case

Description

Camel Case To Normal Text

Demo Code


'use strict';/*from  w w w.j av  a2s. co  m*/

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

Related Tutorials