Java Utililty Methods Array Deep to String

List of utility methods to do Array Deep to String

Description

The list of methods to do Array Deep to String are organized into topic(s).

Method

StringdeepToString(double[][] array)
deep To String
StringBuilder sb = new StringBuilder();
sb.append("[");
for (double[] arr : array) {
    sb.append("[");
    for (double a : arr) {
        sb.append(String.format("%10.3g, ", a));
    sb.append("], ");
...
StringdeepToString(int[] values)
Print the contents of an int[].
StringBuilder b = new StringBuilder();
b.append("[");
for (int i = 0; i < values.length; i++) {
    b.append(values[i]);
    b.append(", ");
b.delete(b.length() - 2, b.length() - 1);
b.append("]");
...
StringdeepToString(Object[] array)
Simple method to walk an array and call toString() on each of the entries.
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < array.length; i++) {
    buffer.append(array[i].toString());
    if (i < array.length - 1) {
        buffer.append(',');
return buffer.toString();
...