转为蛇的样子
@param  string $delimiter
515809
function snake( string $delimiter = '_' ) : SplString
    {
        $string = $this->__toString();
        if( !ctype_lower( $string ) ){
            $string = preg_replace( '/\s+/u', '', ucwords( $this->__toString() ) );
            $string = $this->setString( preg_replace( '/(.)(?=[A-Z])/u', '$1'.$delimiter, $string ) );
            $this->setString( $string );
            $this->lower();
        }
        return $this;
    }
28307
public function implode($key, $delimiter = ',')
    {
        $this->prepare();

        $implode = [];
        if (is_string($key)) {
            return $this->makeImplode($key, $delimiter);
        }

        if (is_array($key)) {
            foreach ($key as $k) {
                $imp = $this->makeImplode($k, $delimiter);
                $implode[$k] = $imp;
            }

            return $implode;
        }
        return '';
    }
1005634
public function concat(string $delimiter = Text::BLANK_TEXT): Text
    {
        $imploded = implode($delimiter, $this->toArrayOfStrings());

        return Text::make($imploded);
    }
103748
public function capitalizeWords( $delimiter = NULL )
	{
		$oldString		= $this->string;
		if( !$delimiter || preg_match( "/ +/", $delimiter ) ){
			$this->string	= ucwords( $oldString );
			return $this->string !== $oldString;
		}
		else{
			$token			= md5( (string) microtime( TRUE ) );
			$work			= str_replace( " ", "{".$token."}", $oldString );
			$work			= str_replace( $delimiter, " ", $work );
			$work			= ucwords( $work );
			$work			= str_replace( " ", $delimiter, $work );
			$this->string	= str_replace( "{".$token."}", " ", $work );
			return $this->string !== $oldString;
		}
	}
229155
public function setDelimiter(string $delimiter): self
    {
        if ($delimiter === $this->delimiter) {
            return $this;
        }

        if (1 === strlen($delimiter)) {
            $this->delimiter = $delimiter;
            $this->resetProperties();

            return $this;
        }

        throw new Exception(sprintf('%s() expects delimiter to be a single character %s given', __METHOD__, $delimiter));
    }
283855
private function explode($string, $delimiter)
    {
        $result = [];
        while (($pos = strrpos($string, $delimiter)) !== false) {
            $result[] = ($string = substr($string, 0, $pos));
        }
        return $result;
    }
698193
protected function snake($value, $delimiter = '_')
    {
        $key = $value . $delimiter;

        if (isset(static::$snakeCache[$key])) {
            return static::$snakeCache[$key];
        }

        if (!ctype_lower($value)) {
            $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1' . $delimiter, $value));
        }

        return static::$snakeCache[$key] = $value;
    }
1306222
public static function slugify($str, $delimiter = '-')
    {
        $temp = preg_replace(
            '/[^a-z0-9]/',
            $delimiter,
            strtolower(trim(strip_tags($str)))
        );

        return preg_replace('/-{2,}/', $delimiter, $temp);
    }
807145
public function explode($delimiter)
    {
        return func_num_args() === 1 ?
            new JArray(explode($delimiter, $this->subject)) :
            new JArray(explode($delimiter, $this->subject, func_get_arg(1)));
    }
548273
public function innerXml($delimiter = '')
    {
        $innerXml = [];

        foreach ($this->node->childNodes as $childNode) {
            $innerXml[] = $childNode->ownerDocument->saveXML($childNode);
        }

        return implode($delimiter, $innerXml);
    }
985468
public function _setTokenStart($delimiter)
    {
        if (
            !($delimiter instanceof Stringable) &&
            !is_string($delimiter) &&
            !is_null($delimiter)
        ) {
            throw $this->_createInvalidArgumentException($this->__('Invalid token start delimiter'), null, null, $delimiter);
        }

        $this->tokenStart = $delimiter;
    }
1207428
public static function explode($delimiter, $string, $limit = null)
    {
        $array = explode($delimiter, $string);

        if (! is_null($limit)) {
            $array = explode($delimiter, $string, $limit);
        }

        return new static($array);
    }
706775
public function segment($delimiter, $index) {
        $parts = $this->split($delimiter);
        $returnValue = (isset($parts[$index - 1])) ? $parts[$index - 1] : '';

        return $this->createClone($returnValue);
    }
716340
public function breakOnDelimiter($delimiter, $s)
    {
        $parts = explode($delimiter, $s);
        foreach ($parts as &$part) {
            $part = '<div class="delimiter">' . $part . '</div>';
        }

        return implode($delimiter, $parts);
    }
520544
public static function part($str, $i, $delimiter, $default = null)
    {
        $parts = explode($delimiter, $str);

        return isset($parts[$i])
            ? $parts[$i]
            : $default;
    }
179774
public function toString($delimiter = ' ') {
        $queryFieldString = '';

        foreach ($this->queryFields as $fieldName => $fieldBoost) {
            $queryFieldString .= $fieldName;

            if ($fieldBoost != 1.0) {
                $queryFieldString .= '^' . number_format($fieldBoost, 1, '.', '');
            }

            $queryFieldString .= $delimiter;
        }

        return rtrim($queryFieldString, $delimiter);
    }
369419
public static function explode($string, $delimiter)
    {
        if (!String::isValid($string) ||
            String::isEmpty($string)) {
            return false;
        }

        return explode($delimiter, $string);
    }