Node.js examples for String:Split
Adds chunking method to strings. Splits string into an array containing substrings of n chars each
String.prototype.chunk = function(n) { var ret = []; //from ww w.ja v a2 s. c o m for(var i=0, len=this.length; i < len; i += n) { ret.push(this.substr(i, n)) } return ret; };