public String getContentBetween( Position starting,
                                     Position end ) {
        CheckArg.isNotNull(starting, "starting");

        int startIndex = starting.getIndexInContent();
        int endIndex = inputString.length();
        if (end != null) {
            endIndex = end.getIndexInContent();
        }

        if (startIndex >= endIndex) {
            throw new IllegalArgumentException(CommonI18n.endPositionMustBeGreaterThanStartingPosition.text(startIndex, endIndex));
        }

        return inputString.substring(startIndex, endIndex);
    }
public String getContentBetween ( Position starting , Position end ) { CheckArg . isNotNull ( starting , "starting" ) ; int startIndex = starting . getIndexInContent ( ) ; int endIndex = inputString . length ( ) ; if ( end != null ) { endIndex = end . getIndexInContent ( ) ; } if ( startIndex >= endIndex ) { throw new IllegalArgumentException ( CommonI18n . endPositionMustBeGreaterThanStartingPosition . text ( startIndex , endIndex ) ) ; } return inputString . substring ( startIndex , endIndex ) ; }
Gets the content string starting at the first position (inclusive) and continuing up to the end position (exclusive).

@param starting the position marking the beginning of the desired content string.
@param end the position located directly after the returned content string; can be null, which means end of content
@return the content string; never null