Here you can find the source of arrayToString(Object[] array)
public static String arrayToString(Object[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static String arrayToString(Object[] array) { return arrayToString(array, ","); }/* w w w .j a v a 2 s. c o m*/ public static String arrayToString(Object[] array, String delimeter, int start, int end) { StringBuilder sb = new StringBuilder(); for (int i = start; i < end; i++) { Object o = array[i]; sb.append(String.valueOf(o)); sb.append(delimeter); } deleteLastDelimeter(sb, delimeter); return sb.toString(); } public static String arrayToString(Object[] array, String delimeter) { return arrayToString(array, delimeter, 0, array.length); } public static void deleteLastDelimeter(StringBuilder sb, String delimeter) { if (sb.length() > delimeter.length()) { sb.delete(sb.length() - delimeter.length(), sb.length()); } } }