implode function

@method implode

@param string $delimiter
496277
public function implode(string $delimiter) : string
    {
        return rtrim($this->fold(function (string $fold, $elem) use ($delimiter) {
            $fold .= A\concat($delimiter, $elem, '');
            return $fold;
        }, '')->getList(), $delimiter);
    }
85983
protected String implode(String[] tabToConcatenate, String pathSeparator) {
		final StringBuilder builder = new StringBuilder();
		for (int i = 0; i < tabToConcatenate.length; i++) {
			builder.append(tabToConcatenate[i]);
			if (i < tabToConcatenate.length - 1) {
				builder.append(pathSeparator);
			}
		}
		return builder.toString();
	}
469819
public function implode($separator = ' : ')
    {
        $m = array_map(
            function (StringType $msg) {
                return $msg();
            },
            $this->messages
        );

        return implode($separator, $m);
    }
207095
public static function explodeEscaped($delimiter, $string, $escapeChar = '\\')
    {
        $d = preg_quote($delimiter, "~");
        $e = preg_quote($escapeChar, "~");
        $tokens = preg_split(
            '~' . $e . '(' . $e . '|' . $d . ')(*SKIP)(*FAIL)|' . $d . '~',
            $string
        );
        return preg_replace(
            ['~' . $e . $e . '~', '~' . $e . $d . '~'],
            [$escapeChar, $delimiter],
            $tokens
        );
    }
1274363
public function lastSegment($delimiter) {
        $parts = $this->split($delimiter);
        $returnValue = end($parts);

        return $this->createClone($returnValue);
    }
1240846
public function convertToOrd($str, $separator = '-') {
		$chars = preg_split('//', $str, -1);
		$res = [];
		foreach ($chars as $char) {
			//$res[] = UnicodeLib::ord($char);
			$res[] = ord($char);
		}
		return implode($separator, $res);
	}
545181
public function str(string $delimiter): self
    {
        $sub = \mb_strstr($this->value, $delimiter, false, (string) $this->encoding());

        if ($sub === false) {
            throw new SubstringException(\sprintf(
                'Substring "%s" not found',
                $delimiter
            ));
        }

        return new self($sub, $this->encoding);
    }
76511
public function flatten($delimiter = '.', $items = null, $prepend = '')
    {
        $flatten = [];

        if (is_null($items)) {
            $items = $this->items;
        }

        foreach ($items as $key => $value) {
            if (is_array($value) && !empty($value)) {
                $flatten = array_merge(
                    $flatten,
                    $this->flatten($delimiter, $value, $prepend.$key.$delimiter)
                );
            } else {
                $flatten[$prepend.$key] = $value;
            }
        }

        return $flatten;
    }
1246158
public function explode($delimiter, $limit = PHP_INT_MAX): array
    {
        return array_slice(array_map('trim', array_filter(explode($delimiter, $this->string, $limit))), 0);
    }
730511
static function titleCase($string, $delimiter = '') {
		return implode($delimiter, array_map('ucfirst', self::getWords($string, true)));
	}
706775
public function segment($delimiter, $index) {
        $parts = $this->split($delimiter);
        $returnValue = (isset($parts[$index - 1])) ? $parts[$index - 1] : '';

        return $this->createClone($returnValue);
    }
1124471
public static function toCamelCase(string $input, string $delimiter = '_'): string
    {
        $str = [];

        foreach (explode($delimiter, $input) as $v) {
            $str[] = ucfirst($v);
        }

        return implode('', $str);
    }
956510
private function replaceWithDelimiter(string $text, string $valid, string $delimiter): string
	{
		$quoted = preg_quote($delimiter);

		// Replace all invalid characters with a single delimiter
		$text = preg_replace(
			'((?:[^'.$valid.']|'.$quoted.')+)us',
			$delimiter,
			$text
		);

		// Remove delimiters from the beginning and the end
		$text = preg_replace('(^(?:'.$quoted.')+|(?:'.$quoted.')+$)us', '', $text);

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

        return explode($delimiter, $string);
    }
428636
public function Explode($delimiter)
    {
        if (!$delimiter || !$string = $this->owner->value) {
            return;
        }
        $values = ArrayList::create();
        foreach (explode($delimiter, $string) as $value) {
            $values->push(
                ArrayData::create(['Value' => $value])
            );
        }
        return $values;
    }
259016
public function getMessage(string $delimiter = ' '): string
    {
        $messages = $this->getMessages();
        $return = [];

        foreach ($messages as $part) {
            if (is_array($part)) {

                $type = $part['type'] ?? '';
                if (!in_array($type, [self::TYPE_PHP])) {
                    $return[] = print_r($part, true);
                } else {
                    $return[] = "PHP [{$part['number']}] {$part['message']} in file {$part['file']}:{$part['line']}";
                }

            } else if (is_object($part) && $part instanceof Throwable) {
                $isCli = defined('KOLDY_CLI') && KOLDY_CLI === true;

                if ($isCli) {
                    $on = '';
                } else {
                    $on = ' on ' . Application::getCurrentURL();
                }

                $className = get_class($part);
                $return[] = "[{$className}] {$part->getMessage()}{$on} in {$part->getFile()}:{$part->getLine()}\n\n{$part->getTraceAsString()}";

            } else if (is_object($part) && method_exists($part, '__toString')) {
                $return[] = $part->__toString();

            } else if (is_object($part)) {
                $return[] = print_r($part, true);

            } else {
                $return[] = $part;

            }
        }

        return implode($delimiter, $return);
    }
675330
public function getName(array $keys = [], string $delimiter = "."): string
    {
        if (empty($keys)) {
            return $this->name;
        }

        $keys[] = $this->name;
        return implode($delimiter, $keys);
    }