src/StringReader.php
public function readUntil($char, $discard_char = true)
    {
        $value = '';

        while(null !== ($one = $this->readOne())) {
            if ($one !== $char || !$discard_char) {
                $value .= $one;
            }

            if ($one === $char) {
                break;
            }
        }

        return $value;
    }
public function readUntil($char, $discard_char = true)
    {
        $value = '';

        while(null !== ($one = $this->readOne())) {
            if ($one !== $char || !$discard_char) {
                $value .= $one;
            }

            if ($one === $char) {
                break;
            }
        }

        return $value;
    }
Read characters until we reach the given character $char.
By default, discard that final matching character and return
the rest.