code: function(start, end) {
  			if (start === undefined) { start = 0; }
  			if (end === undefined) { end = this.getCharCount(); }
  			if (start === end) { return ""; }
  			var offset = 0, chunk = 0, length;
  			while (chunk<this._text.length) {
  				length = this._text[chunk].length; 
  				if (start <= offset + length) { break; }
  				offset += length;
  				chunk++;
  			}
  			var firstOffset = offset;
  			var firstChunk = chunk;
  			while (chunk<this._text.length) {
  				length = this._text[chunk].length; 
  				if (end <= offset + length) { break; }
  				offset += length;
  				chunk++;
  			}
  			var lastOffset = offset;
  			var lastChunk = chunk;
  
  			// error check for invalid chunks of text
  			if (firstChunk >= this._text.length || lastChunk >= this._text.length || firstChunk > lastChunk) {
  				return "";
  			}
  			
  			if (firstChunk === lastChunk) {
  				return this._text[firstChunk].substring(start - firstOffset, end - lastOffset);
  			}
  			var beforeText = this._text[firstChunk].substring(start - firstOffset);
  			var afterText = this._text[lastChunk].substring(0, end - lastOffset);
  			return beforeText + this._text.slice(firstChunk+1, lastChunk).join("") + afterText; 
  		}
docs: Returns the text for the given range.
  <p>
  The end offset is not inclusive. This means that character at the end offset
  is not included in the returned text.
  </p>
  
  @param {Number} [start=0] the zero based start offset of text range.
  @param {Number} [end=char count] the zero based end offset of text range.
  
  @see orion.editor.TextModel#setText