Here you can find the source of arrayToString(T[] array)
public static <T> String arrayToString(T[] array)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String arrayToString(T[] array) { return arrayToDelimitedString(array, 0, array.length, "", "", ""); }/*from www . ja v a2 s . c om*/ public static <T> String arrayToDelimitedString(T[] array, String left, String delimiter, String right) { return arrayToDelimitedString(array, 0, array.length, left, delimiter, right); } public static <T> String arrayToDelimitedString(T[] array, int offset, int length, String delimiter) { return arrayToDelimitedString(array, offset, length, "", delimiter, ""); } public static <T> String arrayToDelimitedString(T[] array, String delimiter) { return arrayToDelimitedString(array, 0, array.length, "", delimiter, ""); } public static <T> String arrayToDelimitedString(T[] array, int offset, int length, String left, String delimiter, String right) { StringBuilder buf = new StringBuilder(); for (int i = offset; i < offset + length - 1; i++) { buf.append(left).append(array[i]).append(right) .append(delimiter); } if (length > 0) buf.append(left).append(array[offset + length - 1]) .append(right); return buf.toString(); } }