code: public static Optional<String> substringBetween(String str, int exclusiveBeginIndex, int exclusiveEndIndex) {
          if (exclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || exclusiveBeginIndex >= exclusiveEndIndex) {
              return Optional.<String> empty();
          }
  
          return Optional.of(str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex));
      }
docs: Returns an empty <code>Optional</code> if {@code exclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || exclusiveBeginIndex >= exclusiveEndIndex},
  otherwise an {@code Optional} with String value: {@code str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex)} is returned.
  
  @param str
  @param exclusiveBeginIndex
  @param exclusiveEndIndex
  @return