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(Object[] array, String separator)
Joins the elements of the provided array into a single string containing the provided list of elements.
if (separator == null) {
    separator = "";
int arraySize = array.length;
int bufSize = (arraySize == 0 ? 0 : (array[0].toString().length() + separator.length()) * arraySize);
StringBuffer buf = new StringBuffer(bufSize);
for (int i = 0; i < arraySize; i++) {
    if (i > 0) {
...
Stringjoin(Object[] array, String seperator)
join
if (array == null)
    return null;
StringBuffer result = new StringBuffer();
for (int i = 0; i < array.length; i++) {
    result.append(array[i]);
    if (i != array.length - 1) {
        result.append(seperator);
return result.toString();
Stringjoin(Object[] elements, CharSequence separator)
join
return join(Arrays.asList(elements), separator);
Stringjoin(Object[] elements, String glue)
Joins each elem in the array with the given glue.
return (join(Arrays.asList(elements), glue));
Stringjoin(Object[] objects)
join
return join(objects, "");
Stringjoin(Object[] parts, String delim)
Join a string array into a single string.
StringBuilder buff = new StringBuilder();
for (int i = 0; i < parts.length; i++) {
    buff.append(parts[i].toString());
    if (i < parts.length - 1) {
        buff.append(delim);
return buff.toString();
...
Stringjoin(Object[] strings, String delimiter)
join
if (strings.length == 0) {
    return "";
StringBuilder builder = new StringBuilder(strings[0].toString());
for (int i = 1; i < strings.length; i++) {
    builder.append(delimiter).append(strings[i].toString());
return builder.toString();
...
Stringjoin(Object[] strings, String spliter)
join
int i = 0;
StringBuffer buffer = new StringBuffer();
for (Object s : strings) {
    if (i == 0) {
        buffer.append(s);
        i = 1;
    } else {
        buffer.append(spliter + s);
...
Stringjoin(Object[] tokens, String delimiter)
join
if (tokens.length == 0)
    return "";
StringBuilder joined = new StringBuilder();
boolean first = true;
for (Object token : tokens) {
    if (!first)
        joined.append(delimiter);
    else
...
Stringjoin(Object[] values, String join)
Joins the values of the array together separated by the join argument.
if (values == null) {
    return null;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < values.length; i++) {
    if (i > 0) {
        sb.append(join);
    sb.append(values[i]);
return sb.toString();