Node.js examples for String:Split
Allows us to break text into chunks of specified size.
String.prototype.chunk = function(n) { if (typeof n=='undefined') {/*from w w w . j a va 2 s . co m*/ n=2; } return this.match(RegExp('.{1,'+n+'}','g')); };