public function strip($str = null, $type = null)
    {

        $func = 'trim';

        if(!is_null($type)){
            self::mustBeString($type, 'Type');
            $type = "$type";

            if(!in_array($type, array('left', 'right', 'both'))){
                throw new \InvalidArgumentException(
                    'Type of strip must be `left`, `right` or `both`'
                );
            }

            if($type == 'left'){
                $func = 'ltrim';
            }

            if($type == 'right'){
                $func = 'rtrim';
            }
        }


        if(!is_null($str)){
            if (is_array($str)) {
                $str = new A($str);
            }

            if ($str instanceof A) {
                return new S($func($this->value, $str->join));
            }
            
            if ($str instanceof H) {
                return new S($func($this->value, $str->to_a->join));
            }


            if (
                is_string($str) 
                ||
                (is_object($str) && method_exists($str, '__toString'))
            ) {
                return new S($func($this->value, $str));
            }

            throw new \InvalidArgumentException(
                'Invalid type given for collection of characters to strip.'
            );
        }

        return new S($func($this->value));
    }