Here you can find the source of arrayToString(String[] array, String delim, boolean quotes)
public static String arrayToString(String[] array, String delim, boolean quotes)
//package com.java2s; //License from project: Apache License public class Main { public static String arrayToString(String[] array, String delim, boolean quotes) { StringBuilder result;//from ww w .ja v a 2 s .c o m String quot = quotes ? "'" : ""; if (array.length == 0) return ""; result = new StringBuilder(); for (String elem : array) { result.append(quot + elem + quot + delim); } result.deleteCharAt(result.length() - 1); return result.toString(); } public static String arrayToString(String[] array) { return arrayToString(array, ",", true); } }