public function insert($offset, $string)
    {
        $offset = (int) $offset;
        $string = static::convertString($string, $this->encoding);

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

        $this->string = mb_substr($this->string, 0, $offset, $this->encoding) .
            $string .
            mb_substr($this->string, $offset, $this->length(), $this->encoding);
        return $this;
    }