public function lastIndexOf($string, $offset = null)
    {
        $string = static::convertString($string, $this->encoding);
        $offset = $offset !== null ? (int) $offset : null;

        if ($offset !== null && ($offset < 0 || $offset >= $this->length())) {
            throw new \OutOfBoundsException();
        }

        return mb_strrpos($this->string, $string, $offset, $this->encoding);
    }