Join the elements of the given array with the given join text.

@param <T> is the type of the elements
@param joinText the text to use for joining.
@param elements the parts of text to join.
@return the joining text
762462
@Pure
	@Inline(value = "TextUtil.join($1, null, null, Arrays.asList($2))", imported = {TextUtil.class, Arrays.class})
	public static <T> String join(String joinText, @SuppressWarnings("unchecked") T... elements) {
		return join(joinText, null, null, elements);
	}
295528
public static void join(StringBuilder sb, Object[] array, String delimiter) {
        if (empty(array)) { return; }
        sb.append(array[0]);
        for (int i = 1; i < array.length; i++) {
            sb.append(delimiter);
            sb.append(array[i]);
        }
    }
698172
def join(self, formatted_texts):
        """"""
        formatted_texts = list(formatted_texts)  # so that after the first iteration elements are not lost if generator
        for formatted_text in formatted_texts:
            assert self._is_compatible(formatted_text), "Cannot join text with different modes"
        self.text = self.text.join((formatted_text.text for formatted_text in formatted_texts))
        return self
494835
public static List<String> texts(Collection<WebElement> elements) {
    return elements.stream().map(ElementsCollection::getText).collect(toList());
  }
141175
@SuppressWarnings("unchecked")
  public <E extends T> T[] concat(T[] oldArray, E newElement) {
    T[] arr = (T[]) Array.newInstance(type, oldArray.length + 1);
    System.arraycopy(oldArray, 0, arr, 0, oldArray.length);
    arr[oldArray.length] = newElement;
    return  arr;
  }
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();

    }
1137115
public static String join(String _delimiter, List<String> _strings) {
        if (_strings == null) {
            return null;
        }
        if (_delimiter == null) {
            _delimiter = "";
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < _strings.size(); i++) {
            sb.append(_strings.get(i));
            if (i < _strings.size() - 1) { // only append delimiter if this is not the last token
                sb.append(_delimiter);
            }
        }
        return sb.toString();
    }
357941
protected String join(Object[] values)
    {
        StringBuilder sb = new StringBuilder(100);
        if(values.length == 0)
            return sb.toString();

        sb.append(values[0]);

        if(values.length == 1)
            return sb.toString();

        for (int i = 1; i < values.length; i++)
        {
            sb.append(",").append(values[i]);
        }

        return sb.toString();
    }
1202654
public static String join(final Object[] array, final String delimiter) {
        
        if(array == null || array.length == 0) {
            return "";
        }
        
        String value = Arrays.stream(array)
                .map(v -> v.toString())
                .collect(Collectors.joining(defaultString(delimiter)));
        
        return value;
    }
247795
@SuppressWarnings("rawtypes")
    public static String join(final Collection<?> col, final String separator,
            final boolean ignoreEmptyElement, final boolean trim, final ElementConverter elementConverter) {

        final List<Object> list = new ArrayList<Object>();
        for(Object element : col) {
            if(element == null) {
                continue;
            }

            Object value = element;

            if(element instanceof String) {
                String str = (String) element;
                if(ignoreEmptyElement && isEmpty(str)) {
                    continue;

                } else if(trim) {
                    value = str.trim();
                }

            } else if(element instanceof Character && isEmpty(element.toString())) {
                String str = element.toString();
                if(ignoreEmptyElement && isEmpty(str)) {
                    continue;

                } else if(trim) {
                    value = str.trim().charAt(0);
                }

            } else if(char.class.isAssignableFrom(element.getClass())) {
                String str = element.toString();
                if(ignoreEmptyElement && isEmpty(str)) {
                    continue;

                } else if(trim) {
                    value = str.trim().charAt(0);
                }
            }

            list.add(value);

        }

        return join(list, separator, elementConverter);

    }
346837
public static <T> String join(Iterator<T> iterator) {
        return new JoinStrings<T>().apply(iterator);
    }
692670
@CheckReturnValue
  public Joiner useForNull(final String nullText) {
    checkNotNull(nullText);
    return new Joiner(this) {
      @Override CharSequence toString(@Nullable Object part) {
        return (part == null) ? nullText : Joiner.this.toString(part);
      }

      @Override public Joiner useForNull(String nullText) {
        throw new UnsupportedOperationException("already specified useForNull");
      }

      @Override public Joiner skipNulls() {
        throw new UnsupportedOperationException("already specified useForNull");
      }
    };
  }
452681
public static String join(Iterator<? extends EncodedPair> pairs, char pairSep){
        return join(pairs, pairSep, '=', false, false);
    }
334998
public static String join(final Iterable<?> elements, final char separator) {
        return Joiner.on(separator).skipNulls().join(elements);
    }
1229086
public static String join(String delimiter, String... parts) {
    if (parts == null) {
      return null;
    }

    if (delimiter == null) {
      delimiter = "";
    }

    StringBuilder stringBuilder = new StringBuilder();
    for (int i=0; i < parts.length; i++) {
      if (i > 0) {
        stringBuilder.append(delimiter);
      }
      stringBuilder.append(parts[i]);
    }
    return stringBuilder.toString();
  }
251695
public static String join(final Collection<?> collection, final String delimiter) {
        
        if(collection == null || collection.isEmpty()) {
            return "";
        }
        
        String value = collection.stream()
                .map(v -> v.toString())
                .collect(Collectors.joining(defaultString(delimiter)));
        
        return value;
    }
1327913
public static String join(String[] array) {
    return array == null ? null : join(asList(array));
  }