Here you can find the source of implode(String delim, String[] args)
private static String implode(String delim, String[] args)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { private static String implode(String delim, String[] args) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < args.length; i++) { if (i > 0) { sb.append(delim);//from w ww.j av a2 s . co m } sb.append(args[i]); } return sb.toString(); } private static String implode(String delim, ArrayList<String> args) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < args.size(); i++) { if (i > 0) { sb.append(delim); } sb.append(args.get(i)); } return sb.toString(); } }