code: public String substring(String str, int startIndex, int endIndex) {
          return (str == null) ? null : str.substring(startIndex, endIndex);
      }
docs: Returns a sub-portion of the given string for the characters that are at
  or after the starting index, and are before the end index.
  
  @param str the source string
  @param startIndex the start index, inclusive
  @param endIndex the ending index, exclusive
  
  @return the specified substring.