code: public static String substring(final String str, final int beginIndex, final int endIndex) {
          assertStringNotNull(str);
          if (str.length() < beginIndex) {
              String msg = "The length of the string was smaller than the begin index:";
              msg = msg + " str=" + str + " beginIndex=" + beginIndex + " endIndex=" + endIndex;
              throw new StringIndexOutOfBoundsException(msg);
          }
          if (str.length() < endIndex) {
              String msg = "The length of the string was smaller than the end index:";
              msg = msg + " str=" + str + " beginIndex=" + beginIndex + " endIndex=" + endIndex;
              throw new StringIndexOutOfBoundsException(msg);
          }
          if (beginIndex > endIndex) {
              String msg = "The begin index was larger than the end index:";
              msg = msg + " str=" + str + " beginIndex=" + beginIndex + " endIndex=" + endIndex;
              throw new StringIndexOutOfBoundsException(msg);
          }
          return str.substring(beginIndex, endIndex);
      }
docs: Extract sub-string by begin and end index. (get scope string)
  <pre>
  substring("flute", 1, 3)
  returns "lu"
  </pre>
  @param str The target string. (NotNull)
  @param beginIndex The from-index.
  @param endIndex The to-index.
  @return The part of string. (NotNull)