Here you can find the source of arrayToString(T[] array, CharSequence start, CharSequence end)
public static <T> String arrayToString(T[] array, CharSequence start, CharSequence end)
//package com.java2s; //License from project: Open Source License public class Main { public static final String COMMA = ","; public static <T> String arrayToString(T[] array, CharSequence start, CharSequence end) { StringBuilder stringBuilder = new StringBuilder(); if (start != null) { stringBuilder.append(start); }// w w w . java 2 s. c o m if (array != null & array.length > 0) { boolean added = false; for (T t : array) { stringBuilder.append(t.toString()); stringBuilder.append(COMMA); added = true; } if (added) { stringBuilder.deleteCharAt(stringBuilder.length() - 1); } } if (end != null) { stringBuilder.append(end); } return stringBuilder.toString(); } }