Wrapper around PHP's join function which
only adds the pieces if they are not empty.
332572
protected function _joinIfNotEmpty($glue, $pieces)
        {
            $filtered_pieces = [];

            foreach ($pieces as $piece) {
                if (is_string($piece)) {
                    $piece = trim($piece);
                }

                if (!empty($piece)) {
                    $filtered_pieces[] = $piece;
                }
            }

            return join($glue, $filtered_pieces);
        }
1229787
function concat () {
  var items = R.dropLast(1, arguments);

  if (!items.length) {
    throw new Error('The helper "concat" must be passed at least one argument.');
  }

  return items.join('');
}
282983
protected function joinClause(
        /*# : string */ $prefix,
        /*# : string */ $seperator,
        array $clause,
        array $settings
    )/*# : string */ {
        if (empty($clause)) {
            return '';
        } else {
            $sepr = $settings['seperator'];
            $join = $settings['join'];
            $pref = empty($prefix) ? $join : ($sepr . $prefix . $join);
            return $pref . join($seperator . $join, $clause);
        }
    }
812774
def join_all(joinables, timeout):
    
    started, elapsed = current_millis(), 0
    for ob in joinables:
        ob.join(timeout=timeout / 1000)
        elapsed = current_millis() - started
        timeout = max(0, timeout - elapsed)
837415
public static void join(StringBuilder sb, Collection<?> collection, String delimiter) {
        if (collection.isEmpty()) { return; }
        Iterator<?> it = collection.iterator();
        sb.append(it.next());
        while (it.hasNext()) {
            sb.append(delimiter);
            sb.append(it.next());
        }
    }
832431
public static String join(Collection collection, String separator) {
        if (isEmpty(collection)) {
            return StringUtils.EMPTY;
        }
        StringBuilder sb = new StringBuilder();
        for (Object object : collection) {
            if (object != null) {
                String string = StringUtils.toString(object);
                if (string != null) {
                    sb.append(string).append(separator);
                }
            }
        }
        return sb.length() > 0 ? sb.substring(0, sb.length() - separator.length()) : StringUtils.EMPTY;
    }
514964
public static String join(String joiner, String... parts) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < parts.length; i++) {
            builder.append(parts[i]);
            if (i < parts.length - 1) {
                builder.append(joiner);
            }
        }
        return builder.toString();
    }
528974
def join(separator = $,)
      result = ""
      if separator
        each_with_index { |obj, i| result << separator if i > 0; result << obj.to_s }
      else
        each { |obj| result << obj.to_s }
      end
      return Erlang.from(result)
    end
254204
public static String join(String separator, Collection<String> stringsToJoin) {
        StringBuilder builder = new StringBuilder();
        // Check if there is at least 1 element then use do/while to avoid trailing separator
        int index = stringsToJoin.size();
        for (String str : stringsToJoin) {
            index--;
            if (str != null) {
                builder.append(str);
                if (index > 0) {
                    builder.append(separator);
                }
            }
        }
        return builder.toString();
    }
295607
static function arrayMerge($array1, $array2, $overwriteValue = true)
    {
//        if($overwriteValue) {
//            foreach ($array2 as $key => $Value) {
//                if (array_key_exists($key, $array1) && is_array($Value)) {
//                    $array1[$key] = self::arrayMergeRecursively(
//                        $array1[$key], $array2[$key], $overwriteValue
//                    );
//                } else {
//                    $array1[$key] = $Value;
//                }
//            }
//        } else {
//            $array1 = array_merge_recursive($array1, $array2);
//        }

        $arrayMerged = array_merge_recursive($array1, $array2);
        $arrayUnique = array_unique($arrayMerged, SORT_STRING);

        return $arrayUnique;
    }
87790
private static String join(String str, int times, String sep) {
    	StringBuilder sb = new StringBuilder();
    	for(int i = 0; i < times; i++) {
    		sb.append(str);
    		if(i < times - 1) {
    			sb.append(sep);
    		}
    	}
    	return sb.toString();
    }
543138
function Join(Table $table, JoinType $join, Condition $condition, $prepend = false)
    {
        $result = $this->Duplicate();
        if ($prepend)
        {
            array_unshift($result->tables, $table);
            array_unshift($result->joins, $join);
            array_unshift($result->conditions, $condition);
        }
        else
        {    
            $result->tables[] = $table;
            $result->joins[] = $join;
            $result->conditions[] = $condition;
        }
        return $result;
    }
638366
public static String join(Object array, char separator, Object... pieces) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0, ii = Array.getLength(array); i < ii; ++i) {
            Object element = Array.get(array, i);
            sb.append(element != null ? element.toString() : "null").append(separator);
        }
        for (int i = 0; i < pieces.length; ++i) {
            sb.append(pieces[i] != null ? pieces[i].toString() : "null").append(separator);
        }
        if (sb.length() > 0) sb.setLength(sb.length()-1);
        return sb.toString();
    }
221379
def join_strings(key, value, fmt, meta):  # pylint: disable=unused-argument
    """"""
    if key in ['Para', 'Plain']:
        _join_strings(value)
    elif key == 'Image':
        _join_strings(value[-2])
    elif key == 'Table':
        _join_strings(value[-5])
635247
function (glue, pieces) {

            var retVal = "",
                tGlue  = "";

            if (arguments.length === 1) {
                pieces = glue;
                glue   = "";
            }

            if (typeof pieces === "object") {
                if ($this.type(pieces) === "array") {
                    return pieces.join(glue);
                }

                $this.each(pieces, function (i) {
                    retVal += tGlue + pieces[i];
                    tGlue = glue;
                });

                return retVal;
            }
        }
276537
def _join(self, rows):
    '''
    
    '''
    rval = 0
    for row in rows:
      if row: rval += row
    return rval
480483
def join_match_funcdef(tokens):
    """"""
    if len(tokens) == 2:
        (func, insert_after_docstring), body = tokens
        docstring = None
    elif len(tokens) == 3:
        (func, insert_after_docstring), docstring, body = tokens
    else:
        raise CoconutInternalException("invalid docstring insertion tokens", tokens)
    # insert_after_docstring and body are their own self-contained suites, but we
    # expect them to both be one suite, so we have to join them together
    insert_after_docstring, dedent = split_trailing_indent(insert_after_docstring)
    indent, body = split_leading_indent(body)
    indentation = collapse_indents(dedent + indent)
    return (
        func
        + (docstring if docstring is not None else "")
        + insert_after_docstring
        + indentation
        + body
    )