Javascript String subStrs()

Description

Javascript String subStrs()


String.prototype.subStrs = function() {
  var output = [];

  for( var i = 0; i < this.length; i++ ) {
    for( var j = 0; j <= this.length; j++ ) {
      if(i < j) {
        output.push(this.substring(i,j));
      }//from w w w . j a va  2s  .  c  om
    };
  };

  return output
};



PreviousNext

Related