List of utility methods to do Array Join
String | join(Object[] array, String glue) join return join(Arrays.asList(array), glue);
|
String | join(Object[] array, String linker) join StringBuilder stringBuilder = new StringBuilder(); if (null == array || 0 == array.length) { return stringBuilder.toString(); stringBuilder.append(array[0]); for (int i = 1; i < array.length; i++) { stringBuilder.append(linker).append(array[i]); return stringBuilder.toString(); |
String | join(Object[] array, String sep) Perform reverse of split on a list. if (array.length == 0) { return ""; StringBuilder result = new StringBuilder(); boolean afterFirst = false; for (Object o : array) { if (afterFirst) { result.append(sep); ... |
String | join(Object[] array, String separator) join if (array == null) { return null; return join(array, separator, 0, array.length); |
String | join(Object[] array, String separator) Joins the elements of the provided array into a single String containing the provided list of elements. No delimiter is added before or after the list. if (array == null) { return null; StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) { Object o = array[i]; if (i > 0) { builder.append(separator); ... |
String | join(Object[] array, String separator) join array of strings by separator StringBuilder ret = new StringBuilder(); for (int i = 0; i < array.length; i++) { if (i != 0) { if (separator != null) { ret.append(separator); ret.append(array[i]); ... |
String | join(Object[] array, String separator) Joins the elements of the provided array into a single String containing the provided list of elements. No delimiter is added before or after the list. if (array == null) { return null; return join(array, separator, 0, array.length); |
String | join(Object[] array, String separator) Joins the elements of the given array to a string, separated by the given separator string. return array != null ? join(Arrays.asList(array), separator) : null;
|
String | join(Object[] array, String separator) Join the objects in array with the given separator Useful for making a comma separated list, or URL query string int num = array.length; if (num == 0) return ""; String out = array[0].toString(); for (int ii = 1; ii < num; ii++) { out += (separator + array[ii].toString()); return out; ... |
String | join(Object[] array, String separator) Joins the elements of the given array to a string, separated by the given separator string. return array != null ? join(Arrays.asList(array), separator) : null;
|