List of utility methods to do Array to String
String | arrayToString(T[] ar) array To String StringBuilder sb = new StringBuilder("["); boolean first = true; for (Object o : ar) { if (!first) { sb.append(", "); sb.append(o); first = false; ... |
String | arrayToString(T[] array) array To String return arrayToDelimitedString(array, 0, array.length, "", "", ""); |
String | arrayToString(T[] array) array To String return arrayToString(array, ",", "", ""); |
String | arrayToString(T[] array) Get a String representation of an array of any type. StringBuilder sb = new StringBuilder(); if (array == null) sb.append("null"); else { sb.append("["); for (int i = 0; i < array.length; i++) { if (i > 0) sb.append(","); ... |
String | arrayToString(T[] array) array To String return arrayToString(array, ", "); |
String | arrayToString(T[] array) array To String if (array != null) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) { Object object = (Object) array[i]; builder.append(String.valueOf(object)); if (i < array.length - 1) { builder.append(", "); return builder.toString(); } else { return "" + null; |
String | arrayToString(T[] array) Provides a string representation for the given array. return arrayToString(array, "", "", " "); |
String | arrayToString(T[] array, CharSequence start, CharSequence end) array To String StringBuilder stringBuilder = new StringBuilder(); if (start != null) { stringBuilder.append(start); if (array != null & array.length > 0) { boolean added = false; for (T t : array) { stringBuilder.append(t.toString()); ... |
String | arrayToString(T[] items, String delimiter) Pretty print an array of objects of type T if (null == items) { return "null"; StringBuilder buf = new StringBuilder(); for (T cur : items) { if (buf.length() > 0) { buf.append(delimiter); buf.append(cur.toString()); return buf.toString(); |
String | arrayToString2D(String title, String innerTitle, double[][] vect) array To String D String result = title + ": \n"; for (int i = 0; i < vect.length; i++) { result += printArray(innerTitle + " " + i, vect[i]) + "\n"; return result + "\n"; |