Dumps the node descendants into a string using XML formatting.

@param string $delimiter

@return string
548273
public function innerXml($delimiter = '')
    {
        $innerXml = [];

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

        return implode($delimiter, $innerXml);
    }
974687
public function recvLine($delimiter = "\n") {
        $str = '';
        while (!$this->stream_eof()) {
            $char = $this->recvChr();
            $str .= $char;
            if ($char === false) { return $str; }
            if (strpos($str, $delimiter) !== false) { return $str; }
        }
        return $str;
    }
457253
public static function csplit($string, $delimiter = ',')
    {
        if (is_array($string)) {
            return $string;
        }
        $res = [];
        foreach (explode($delimiter, $string) as $k => $v) {
            $v = trim($v);
            if (strlen($v)) {
                array_push($res, $v);
            }
        }

        return $res;
    }
160753
public function explode($delimiter, $limit = null)
    {
        // Fix HHVM default explode limit issue
        // @see  https://github.com/facebook/hhvm/issues/7696
        // @see  https://3v4l.org/fllad
        if ($limit === null) {
            $limit = defined('HHVM_VERSION') ? 0x7FFFFFFF : PHP_INT_MAX;
        }

        return explode($delimiter, $this->string, $limit);
    }
776101
public static function csvFileToArray($filename='', $delimiter=',')
    {
        $header = null;
        $data = [];
        if (($handle = fopen($filename, 'r')) !== false) {
            while (($row = fgetcsv($handle, 1000, $delimiter)) !== false) {
                if (!$header) {
                    $header = $row;
                } else {
                    $data[] = array_combine($header, $row);
                }
            }
            fclose($handle);
        }

        return $data;
    }
1274363
public function lastSegment($delimiter) {
        $parts = $this->split($delimiter);
        $returnValue = end($parts);

        return $this->createClone($returnValue);
    }
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);
    }
552967
protected function _stringNode($delimiter = '', $heredoc = false)
    {
        $this->_codeNode();
        $token = $this->_stream->current(true);
        if (!$delimiter) {
            $this->_states['body'] = $token[1];
        } elseif ($delimiter === '"') {
            $this->_states['body'] = $token[1] . $this->_stream->next('"');
        } else {
            $this->_states['body'] = $token[1] . $this->_stream->nextSequence($delimiter);
        }
        if ($heredoc) {
            $this->_states['body'] .= $this->_stream->next([';']);
        }

        $node = new NodeDef($this->_states['body'], 'string');
        $this->_contextualize($node);
        return $node;
    }
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 '';
    }
737652
protected function nodeToString(string $indent = ''): string
    {
        $str = $indent . "--{$this->getName()}--\n";

        foreach ($this->getChildren() as $child)
        {
            $str .= $child->nodeToString($indent . '  ');
        }

        return $str;
    }
159168
public function removeWordDelimiter ($delimiter)
    {
        if (empty($delimiter)) {
            throw new Exception('Word delimiter cannot be null.');
        }
        if (is_array($delimiter)) {
            foreach ($delimiter as $delim) {
                $this->removeWordDelimiter($delim);
            }
        } else {
            if (! in_array($delimiter, $this->getWordDelimiters())) {
                throw new Exception("Word delimiter '$delimiter' is not in delimiters array.");
            }
            $newArray = array();
            foreach ($this->_wordDelimiters as $delim) {
                if ($delim != $delimiter) {
                    $newArray[] = $delim;
                }
                $this->_wordDelimiters = $newArray;
            }
        }
        return $this;
    }
84318
public static function csvFields(string $line, string $delimiter = ','): array
    {
        if (trim($line) === '') {
            return [];
        }
        $fields = [];
        $parts = str_getcsv($line, $delimiter);
        if ($parts !== null && count($parts) > 0) {
            foreach ($parts as $part) {
                $part = trim($part);
                if (substr($part, 0, 1) === '"' || substr($part, 0, 1) === '\'') {
                    $part = substr($part, 1);
                }
                if (substr($part, -1) === '"' || substr($part, -1) === '\'') {
                    $part = substr($part, 0, -1);
                }
                if ($part !== '') {
                    $fields[] = $part;
                }
            }
        }
        return $fields;
    }
1330035
public static function formatXml(string $xml): string
    {
        if (empty($xml)) {
            return '';
        }

        $doc = new \DOMDocument();
        $doc->preserveWhiteSpace = false;
        $doc->formatOutput = true;
        $doc->loadXML($xml);

        return $doc->saveXML();
    }
406830
public static function convertCamel($str, $separators = ['_', '-'], $delimiter = '')
	{
		$str = ucwords(str_replace($separators, ' ', $str));

		return str_replace(' ', $delimiter, $str);
	}
707679
public static function explodeWithCleanup(string $delimiter, string $string): array
    {
        $stringValues = explode($delimiter, $string);
        $parsedValues = [];
        foreach ($stringValues as $k => $v) {
            $v = trim($v);
            if (empty($v)) {
                continue;
            }
            $parsedValues[] = $v;
        }

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

        return explode($delimiter, $string);
    }
1180503
private static function getPathNodes($path, $delimiter = '.')
    {
        if (is_array($path)) {
            return $path;
        }

        if ($path && strpos((string) $path, $delimiter) === false) {
            return [$path];
        }

        return array_values(array_filter(explode($delimiter, (string) $path), 'strlen'));
    }