public boolean consumeOptional(char c) {
        if (s.charAt(p)!=c) return false;
        p++;
        return true;
    }
Advances the position by 1 if the character at the current position is c.
Does nothing otherwise.

@return whether this consumed a c at the current position, or if it did nothing
vespajlib/src/main/java/com/yahoo/text/PositionedString.java