joins all given elements with a special separator

@param elements elements to join
@param separator separator to use
@return elements as string
334998
public static String join(final Iterable<?> elements, final char separator) {
        return Joiner.on(separator).skipNulls().join(elements);
    }
565118
public static function oxford_join($arr, string $separator = 'and') {
		if (! \is_array($arr) || ! \count($arr)) {
			return '';
		}

		$separator = \trim($separator);
		if (! $separator) {
			$separator = 'and';
		}
		$separator = " $separator ";

		// Let's build a nice array of joinable elements.
		$out = array();
		foreach ($arr as $v) {
			if ($v && (\is_string($v) || \is_numeric($v))) {
				$out[] = (string) $v;
			}
		}

		// Low counts don't require commas.
		if (\count($out) <= 2) {
			return \implode($separator, $out);
		}

		$last = (string) \array_pop($out);
		return \implode(', ', $out) . ",$separator" . $last;
	}
76335
public static String join(char sep, Iterable itr) {
        return join(String.valueOf(sep), itr);
    }
1175579
public static String join(String[] strings, String separator) {
      StringBuilder sb = new StringBuilder();
      boolean first = true;
      for (String s : strings) {
         if (first) {
            first = false;
         } else {
            sb.append(separator);
         }
         sb.append(s);
      }
      return sb.toString();
   }
835572
public String joinIgnoreNull(String separator, final String keyValueSeparator) {
		return MapUtil.joinIgnoreNull(this.map, separator, keyValueSeparator);
	}
1339405
public static String join(String separator, String[] parts) {
        StringBuilder builder = new StringBuilder();
        boolean first = true;
        for (String part : parts) {
            if (first) {
                first = false;
            } else {
                builder.append(separator);
            }
            builder.append(part);
        }
        return builder.toString();
    }
810595
public static String join( Object[] objects, char sep )
	{
		if( objects.length == 0 )
		{
			return "";
		}
		StringBuffer buffer = new StringBuffer( objects[0].toString() );
		for (int i = 1; i < objects.length; i++)
		{
			buffer.append( sep );
			buffer.append( objects[i].toString() );
		}
		return buffer.toString();
	}
573877
@SuppressWarnings({"rawtypes", "unchecked"})
    public static String join(final Object[] arrays, final String separator, final ElementConverter elementConverter) {

        if(arrays == null) {
            return "";
        }

        final int len = arrays.length;
        if(len == 0) {
            return "";
        }

        StringBuilder sb = new StringBuilder();
        for(int i=0; i < len; i++) {
            final Object element = arrays[i];
            sb.append(elementConverter.convertToString(element));

            if(separator != null && (i < len-1)) {
                sb.append(separator);
            }
        }

        return sb.toString();

    }
1195739
public String join(String separator) throws JSONException {
		int len = this.rawList.size();
		StringBuilder sb = new StringBuilder();

		for (int i = 0; i < len; i += 1) {
			if (i > 0) {
				sb.append(separator);
			}
			sb.append(InternalJSONUtil.valueToString(this.rawList.get(i)));
		}
		return sb.toString();
	}
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();
    }
498417
public static <T> String join(List<T> list, String separator) {
		StringBuilder builder = new StringBuilder();
		int i = 0;
		for (T t : list) {
			builder.append(t);
			if (++i < list.size()) builder.append(separator);
		}
		return builder.toString();
	}
252653
public M joinsWith(String separator, Object... join) {
		this.delegate = Optional.of(joinWith(separator, join));
		return THIS();
	}
371212
public static <T> String join(final Collection<T> collection, final String separator) {

        if (isEmpty(collection)) {
            return "";
        }
        StringBuffer stringBuffer = new StringBuffer();
        boolean isFirstVisited = true;
        for (Object object : collection) {
            if (isFirstVisited) {
                isFirstVisited = false;
            } else {
                stringBuffer.append(separator);
            }
            stringBuffer.append(ObjectUtils.toString(object));
        }
        return stringBuffer.toString();
    }
1362836
public static String join(Iterable<?> iterable, String separator) {
        if (iterable != null) {
            StringBuilder buf = new StringBuilder();
            Iterator<?> it = iterable.iterator();
            char singleChar = separator.length() == 1 ? separator.charAt(0) : 0;
            while (it.hasNext()) {
                buf.append(it.next());
                if (it.hasNext()) {
                    if (singleChar != 0) {
                        // More efficient
                        buf.append(singleChar);
                    } else {
                        buf.append(separator);
                    }
                }
            }
            return buf.toString();
        } else {
            return "";
        }
    }
653831
public static String join(String delimiter, Iterable<String> strings) {
    StringBuilder sb = new StringBuilder();
    for (String item : strings) {
      if (sb.length() > 0) sb.append(delimiter);
      sb.append(item);
    }
    return sb.toString();
  }
1119849
public static <K, V> String join(Map<K, V> map, String separator, String keyValueSeparator) {
		return join(map, separator, keyValueSeparator, false);
	}
724268
public static String join(final Object array, final String separator) {

    return isArray(array) ? join(toArray(array, ClassUtils.getComponentClass(array)), separator)
      : Objects.toString(array);
  }