Stringy\Stringy::delimit PHP 메소드

delimit() 공개 메소드

Delimiters are inserted before uppercase characters (with the exception of the first character of the string), and in place of spaces, dashes, and underscores. Alpha delimiters are not converted to lowercase.
public delimit ( string $delimiter ) : Stringy
$delimiter string Sequence used to separate parts of the string
리턴 Stringy Object with a delimited $str
    public function delimit($delimiter)
    {
        $regexEncoding = $this->regexEncoding();
        $this->regexEncoding($this->encoding);
        $str = $this->eregReplace('\\B([A-Z])', '-\\1', $this->trim());
        $str = \mb_strtolower($str, $this->encoding);
        $str = $this->eregReplace('[-_\\s]+', $delimiter, $str);
        $this->regexEncoding($regexEncoding);
        return static::create($str, $this->encoding);
    }