code: public String extract(int start, int end) {
  
          if ((start < 0) || (start >= end) || (end > length))
              return ("");
          else
              return (string.substring(start, end));
  
      }
docs: Extract and return a substring that starts at the specified position,
  and ends at the character before the specified position.  If this is
  not possible, a zero-length string is returned.
  
  @param start Starting index, zero relative, inclusive
  @param end   Ending index, zero relative, exclusive
  @return The result string from start to end