Javascript String toController()
toController()
'use strict';/*from w w w.j av a2 s . c o m*/ String.prototype.toController = function () { return this.replace(/([a-z](?=[A-Z]))Controller/g, '$1.controller').toLowerCase(); };