function clean($separator = '-', $length = -1)
    {
        // replace non alphanumeric and non underscore charachters by separator
        $this->replace('/[^a-z0-9]/i', $separator);
        if (!empty($separator)) {
            // replace multiple occurences of separator by one instance
            $this->replace('/'.preg_quote($separator).'['.preg_quote($separator).']*/', $separator);
        }
        // cut off to maximum length
        if ($length > -1 && $this->length() > $length) {
            $this->truncate($length, '');
        }

        // remove separator from start and end of string
        $this->trim($separator);
        return $this;
    }