List of utility methods to do Array Join
String | join(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) { ... |
String | join(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(); |
String | join(Object[] elements, CharSequence separator) join return join(Arrays.asList(elements), separator);
|
String | join(Object[] elements, String glue) Joins each elem in the array with the given glue. return (join(Arrays.asList(elements), glue));
|
String | join(Object[] objects) join return join(objects, ""); |
String | join(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(); ... |
String | join(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(); ... |
String | join(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); ... |
String | join(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 ... |
String | join(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(); |