List of utility methods to do Array Join
int[] | arrayJoin(int[] a, int[] b) array Join int[] result = new int[a.length + b.length]; System.arraycopy(a, 0, result, 0, a.length); System.arraycopy(b, 0, result, a.length, b.length); return result; |
String | arrayJoin(String[] arr, String joinStr) array Join if (arr == null || arr.length == 0) return null; if (joinStr == null) joinStr = ""; StringBuffer buf = new StringBuffer(); for (String str : arr) buf.append(str).append(joinStr); return buf.substring(0, buf.length() - joinStr.length()); ... |
String | arrayJoin(String[] array, char with) array Join if (array == null || array.length == 0) { return ""; int len = array.length; StringBuilder sb = new StringBuilder(16 + len * 8); sb.append(array[0]); for (int i = 1; i < len; i++) { sb.append(with); ... |
String | arrayJoinToString(Object[] array, CharSequence delim) array Join To String StringBuffer sb = new StringBuffer(); boolean first = true; for (Object o : array) { if (first) first = false; else sb.append(delim); sb.append(o.toString()); ... |
byte[] | join(byte[]... bs) Join. int len = 0; for (byte[] b : bs) { len += b.length; byte[] out = new byte[len]; int offset = 0; for (byte[] b : bs) { System.arraycopy(b, 0, out, offset, b.length); ... |
String | join(char sep, Object[] array) join return join(sep, Arrays.asList(array));
|
String | join(CharSequence separator, String[] strings) Concatenates strings, using a separator. StringBuilder sb = new StringBuilder(); boolean first = true; for (String s : strings) { if (first) { first = false; } else { sb.append(separator); sb.append(s); return sb.toString(); |
String | join(CharSequence[] strings, CharSequence separator) Joins the strings in 'strings' with 'separator' between each. StringBuilder result = new StringBuilder(); for (CharSequence string : strings) { if (result.length() > 0) { result.append(separator); result.append(string); return result.toString(); ... |
String | join(final Object[] array) join return join(array, ", "); |
String | join(final Object[] array, final char separator) join if (array == null) { return null; return join(array, separator, 0, array.length); |