Here you can find the source of arrayToString(String[] a, String separator)
public static String arrayToString(String[] a, String separator)
//package com.java2s; public class Main { public static String arrayToString(String[] a, String separator) { StringBuffer result = new StringBuffer(); if (a.length > 0) { result.append(a[0]);/* w w w . ja v a 2s .com*/ for (int i = 1; i < a.length; i++) { result.append(separator); result.append(a[i]); } } return result.toString(); } }