public String consumeTo(char c) {
        int nextC=indexOf(c);
        if (nextC<0)
            throw new IllegalArgumentException("Expected a string terminated by '" + c + "' " + at());
        String value=substring(nextC);
        p=nextC;
        return  value;
    }
Sets the position of this to the next occurrence of c after the current position.

@param c the char to move the position to
@return the substring between the current position and the new position at c
@throws IllegalArgumentException if there was no occurrence of c after the current position
vespajlib/src/main/java/com/yahoo/text/PositionedString.java