Java Utililty Methods Array Join

List of utility methods to do Array Join

Description

The list of methods to do Array Join are organized into topic(s).

Method

Stringjoin(String[] array, String delimiter)
Combine the string elements in the array to form a new string, composed of all the elements where each element is separated by the delimiter string.
String result = null;
if (delimiter == null) {
    delimiter = "";
if (array != null) {
    if (array.length == 0) {
        return result;
    result = array[0];
    for (int i = 1; i < array.length; i++) {
        if (array[i] != null) {
            result = result + delimiter + array[i];
return result;
Stringjoin(String[] array, String delimiter)
Joins the items in array with a delimiter.
if (empty(array)) {
    return "";
StringBuilder sb = new StringBuilder();
join(sb, array, delimiter);
return sb.toString();
Stringjoin(String[] array, String sep)
join
return join(Arrays.asList(array), sep);
Stringjoin(String[] array, String separator)
join
StringBuilder sb = new StringBuilder(1024);
boolean first = true;
for (String item : array) {
    if (first) {
        first = false;
    } else {
        sb.append(separator);
    sb.append(item);
return sb.toString();
Stringjoin(String[] array, String separator)
join
StringBuilder sb = new StringBuilder(1024);
boolean first = true;
for (String item : array) {
    if (first) {
        first = false;
    } else {
        sb.append(separator);
    sb.append(item);
return sb.toString();
Stringjoin(String[] array, String separator)
Joins elements from a given array into a String .
if (array.length == 0)
    return "";
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < array.length; i++)
    out.append(separator).append(array[i]);
return out.toString();
Stringjoin(String[] arrayOfString)
join
return join(arrayOfString, null);
Stringjoin(String[] datalines)
join
return String.join("", Arrays.asList(datalines));
Stringjoin(String[] elements, String separator)
join
return join(elements, separator, 0);
Stringjoin(String[] elements, String separator)
Join strings with separator.
StringBuilder sb = new StringBuilder();
int length = elements.length;
for (int i = 0; i < length; i++) {
    sb.append(elements[i]);
    if (i + 1 < length) {
        sb.append(separator);
return sb.toString();