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 sep, final String[] strings)
join
if (strings == null) {
    return null;
final int length = strings.length;
if (length == 0) {
    return STR_EMP;
final int sepLen;
...
Stringjoin(String sep, Object[] os)
join
return join(sep, Arrays.asList(os));
Stringjoin(String sep, String[] a)
join
if (a.length == 0)
    return "";
if (a.length == 1)
    return a[0];
StringBuffer sbuff = new StringBuffer();
sbuff.append(a[0]);
for (int i = 1; i < a.length; i++) {
    if (sep != null)
...
Stringjoin(String sep, String[] arr)
Join an array of Strings using given separator
if (arr == null)
    return null;
StringBuilder str = new StringBuilder();
for (int i = 0; i < arr.length; i++)
    str.append(i == 0 ? arr[i] : sep + arr[i]);
return str.toString();
Stringjoin(String separator, String... array)
join
return join(separator, Arrays.asList(array));
Stringjoin(String separator, String[] strings)
join an array of strings given a seperator
return join(separator, strings, 0, strings.length);
Stringjoin(String separator, String[] strings)
join an array of strings given a seperator
return join(separator, strings, 0, strings.length);
Stringjoin(String[] a, String delimiter, Integer startIndex)
join
try {
    Collection<String> s = Arrays.asList(a);
    StringBuffer buffer = new StringBuffer();
    Iterator<String> iter = s.iterator();
    while (iter.hasNext()) {
        if (startIndex == 0) {
            buffer.append(iter.next());
            if (iter.hasNext()) {
...
String[]join(String[] a, String[] b)
join
String[] temp = new String[a.length + b.length];
System.arraycopy(a, 0, temp, 0, a.length);
System.arraycopy(b, 0, temp, a.length, b.length);
Arrays.sort(temp); 
return temp;
String[]join(String[] a1, String[] a2)
join
List<String> result = new ArrayList<>();
result.addAll(Arrays.asList(a1));
result.addAll(Arrays.asList(a2));
return result.toArray(new String[0]);