List of utility methods to do Array to String
String | arrayToString(double d[]) array To String String s = ""; for (int i = 0; i < d.length; i++) { s = s + df.format(d[i]); if (i < d.length - 1) s = s + ","; return s; |
String | arrayToString(double... a) array To String StringBuffer result = new StringBuffer(); if (a.length > 0) { result.append(a[0]); for (int i = 1; i < a.length; i++) { result.append(","); result.append(a[i]); return "[" + result.toString() + "]"; |
String | arrayToString(double[] array) array To String StringBuffer sb = new StringBuffer(); for (int r = 0; r < array.length; r++) { sb.append(array[r] + ","); return sb.toString(); |
String | arrayToString(double[] array, String separator) array To String int length = array.length; if (length == 0) return ""; StringBuilder sb = new StringBuilder(); for (int i = 0; i < length; ++i) { sb.append(array[i]); if (i < length - 1) sb.append(separator); ... |
String | arrayToString(double[] v) array To String return arrayToString(v, null);
|
String | arrayToString(double[] xs) array To String StringBuilder sb = new StringBuilder(); sb.append('['); for (double x : xs) { if (sb.length() != 1) sb.append(", "); sb.append(x); sb.append(']'); ... |
String | arrayToString(final byte[] array) array To String try { return new String(array, ASCII_CHARSET); } catch (UnsupportedEncodingException e) { return null; |
String | arrayToString(final byte[] array, final int start, final int length) Convert the contents of the specified array to a String , starting at an offset of start , for length .
int i; int count; final byte[] temp; count = 0; temp = new byte[length]; for (i = start; i < (start + length); i++) { if ((array[i] >= 0) && (array[i] < 32)) { temp[count] = 32; ... |
String | arrayToString(final float[] array) Build a string from an array. if (array.length == 0) { return ""; StringBuilder sb = new StringBuilder(); for (Float o : array) { sb.append(o.toString()); sb.append('|'); sb.deleteCharAt(sb.length() - 1); return sb.toString(); |
String | arrayToString(final Object[] a) Converts the given array of Objects into a String. if (a == null) return "null"; if (a.length == 0) return ""; final StringBuffer sb = new StringBuffer(); sb.append(a[0].toString()); for (int i = 1; i < a.length; i++) { sb.append(","); ... |