public function center($width = 79, $cut = PHP_EOL)
    {
        self::mustBeInteger($width, 'Width');
        self::mustBeString($cut, 'Cut character');

        if (is_object($width)) {
            $width = $width->int;
        }

        if($width <= 0){
            throw new \InvalidArgumentException('Width cannot be null or negative!');
        }


        $a = $this->strip()->wrap($width, $cut)->split('/'.$cut.'/u');

        $s = '';

        while ($a->valid()) {
            $diff = new N(($width - count($a->current)) / 2);

            if ($diff->decimal->zero) {
                $left = $right = $diff->int;
            } else {
                if ($a->index->odd) {
                    $left = $diff->ceil;
                    $right = $diff->floor;
                } else {
                    $left = $diff->floor;
                    $right = $diff->ceil;
                }
            }
            $s .= $a->current->margin($left, $right);

            if (!$a->is_last) {
                $s .= $cut;
            }
            $a->next();
        }

        return new S($s);
    }