public function section($separator, $first = 0, $last = 0)
    {
        $sections = explode($separator, $this->string);

        $total = count($sections);
        $first = intval($first);
        $last = intval($last);

        if ($first > $total) {
            return null;
        }
        if ($first > $last) {
            $last = $first;
        }

        for ($i = 0; $i < $total; $i++) {
            if ($i < $first || $i > $last) {
                unset($sections[$i]);
            }
        }

        $string = implode($separator, $sections);

        return new self($string);
    }
public function section($separator, $first = 0, $last = 0)
    {
        $sections = explode($separator, $this->string);

        $total = count($sections);
        $first = intval($first);
        $last = intval($last);

        if ($first > $total) {
            return null;
        }
        if ($first > $last) {
            $last = $first;
        }

        for ($i = 0; $i < $total; $i++) {
            if ($i < $first || $i > $last) {
                unset($sections[$i]);
            }
        }

        $string = implode($separator, $sections);

        return new self($string);
    }
Returns a section of the string.

@param  string $separator
@param  integer $first
@param  integer $last
@return StringHelper