@NonNull
    public static String getTextAfterIndexUntil(final String text, final int idx, @Nullable final String endToken, final int maxLength) {
        if (StringUtils.isEmpty(text) || idx >= text.length() - 1) {
            return "";
        }
        String after = text.substring(idx < 0 ? 0 : idx + 1);
        if (StringUtils.isNotEmpty(endToken)) {
            final int tokenIdx = after.indexOf(endToken);
            if (tokenIdx >= 0) {
                after = after.substring(0, tokenIdx);
            }
        }
        return (maxLength >= 0 && after.length() > maxLength) ? after.substring(0, maxLength) : after;
    }
Returns substring of text after (and excluding) given 'idx' until one of given conditions is met

@param text      text to work on
@param idx       idx to start checking
@param endToken  if not null, return text until (and excluding) this token is found
@param maxLength if >=0, text is truncated to given max length
@return found text or empty string. Never null.
main/src/main/java/cgeo/geocaching/utils/TextUtils.java