Concatenates an array of column names or values.

@param   array   $values     An array of values to concatenate.
@param   string  $separator  As separator to place between each value.

@return  string  The concatenated values.

@since   1.0
975606
public function concatenate($values, $separator = null)
	{
		if ($separator)
		{
			$concat_string = 'CONCAT_WS(' . $this->quote($separator);

			foreach ($values as $value)
			{
				$concat_string .= ', ' . $value;
			}

			return $concat_string . ')';
		}

		return 'CONCAT(' . implode(',', $values) . ')';
	}
745284
public final static function join($separator, $source){
		return implode($separator, array_map(function($value){ return self::cast($value); },
			array_filter(Arr::simplify(array_slice(func_get_args(), 1)))));
	}
953893
public static function toString(array $array, string $delimiter = ', '): string
    {
        if (!$array) {
            return '';
        }

        foreach ($array as $key => $value) {
            if (!$value) {
                unset($array[$key]);
            }
        }

        return implode($delimiter, $array);
    }
256702
public static String join(String separator, List<String> topicsArray) {

    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < topicsArray.size(); i++) {

      if (sb.length() > 0) {
        sb.append(",");
      }
      sb.append(topicsArray.get(i));
    }
    return sb.toString();
  }
479395
public static function arrayToString($arr, $separator = ',', $comma = '\'')
    {
        $result = array_reduce($arr, function ($carry, $param) use ($separator, $comma) {
            $segment = $comma . $param . $comma;
            return $carry ? $carry . "{$separator} {$segment}" : "{$segment}";
        }, null);
        return $result;
    }
285387
public static String join(String separator, Object... values) {
		return join(Arrays.asList(values), separator);
	}
420570
public function concat(array $values, string $delimiter = ''): string
    {
        if ($delimiter) {
            return implode(' + ' . $delimiter . ' + ', $values);
        }

        return implode(' + ', $values);
    }
25828
public function split($separator = null)
    {
        if (is_null($separator) === true) {
            return [$this->subject];
        }

        return new JArray(explode($separator, $this->subject));
    }
166229
public function toString($separator = null)
    {
        if (!is_null($separator)) {
            $this->_separator = $separator;
        }

        $this->_prepareData();
        return $this->__toString();
    }
1115586
protected function parameterizeValues(array $values)
    {
        foreach ($values as &$value) {
            $value = $this->parameterize($value);
        }

        return '('.implode(',', $values).')';
    }
355377
public function mapColumnsWithValues($columns, $values)
    {
        // If $values is null, then use $columns to build it up
        if (is_null($values)) {

            if ($this->isAssoc($columns)) {

                // Incoming is associative array, split it up in two
                $values = array_values($columns);
                $columns = array_keys($columns);

            } else {

                // Create an array of '?' to match number of columns
                $max = count($columns);
                for ($i = 0; $i < $max; $i++) {
                    $values[] = '?';
                }
            }
        }

        return [$columns, $values];
    }
469819
public function implode($separator = ' : ')
    {
        $m = array_map(
            function (StringType $msg) {
                return $msg();
            },
            $this->messages
        );

        return implode($separator, $m);
    }
1042843
@Nonnull
    public static String join(@Nonnull Collection<?> strings, @Nonnull String separator) {
        StringBuilder buf = new StringBuilder();
        boolean first=true;
        for (Object s : strings) {
            if(first)   first=false;
            else        buf.append(separator);
            buf.append(s);
        }
        return buf.toString();
    }
371445
public static function getNonEmptyValuesAsString(array $values, $separator = ', ')
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($values)) {
            return null;
        }

        $nonEmpty = self::getNonEmptyValues($values);

        /*
         * No values?
         * Nothing to do
         */
        if (empty($nonEmpty)) {
            return '';
        }

        return implode($separator, $nonEmpty);
    }
29611
public static function pregQuote($values, $delimiter = null)
    {
        if (!is_array($values)) {
            return preg_quote($values, $delimiter);
        }

        // Case: needle is array
        foreach ($values as $key => $value) {
            $values[$key] = preg_quote($value, $delimiter);
        }

        return implode('|', $values);
    }
144188
public static function concatenate($str, $suffix, $separator)
    {
        if (empty($suffix)) {
            return $str;
        }
        if (empty($str)) {
            return $suffix;
        }

        return $str . $separator . $suffix;
    }
661279
public static String join(final Object[] arrays, final String separator) {

        return join(arrays, separator, ELEMENT_CONVERTER);

    }