List of utility methods to do Array Join
String | join(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; |
String | join(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(); |
String | join(String[] array, String sep) join return join(Arrays.asList(array), sep);
|
String | join(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(); |
String | join(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(); |
String | join(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(); |
String | join(String[] arrayOfString) join return join(arrayOfString, null);
|
String | join(String[] datalines) join return String.join("", Arrays.asList(datalines)); |
String | join(String[] elements, String separator) join return join(elements, separator, 0);
|
String | join(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(); |