Here you can find the source of implode(Object[] data, String delimiter)
public static String implode(Object[] data, String delimiter)
//package com.java2s; public class Main { /**//w w w . j a va2s .com * Empty String. */ public final static String EMPTY = ""; public static String implode(Object[] data) { return implode(data, ", "); } public static String implode(Object[] data, String delimiter) { String implodedString; if (data.length == 0) { implodedString = EMPTY; } else { StringBuffer sb = new StringBuffer(); sb.append(data[0]); for (int i = 1; i < data.length; i++) { sb.append(delimiter); sb.append(data[i]); } implodedString = sb.toString(); } return implodedString; } }