Here you can find the source of implode(final String[] pStrArray)
public static String implode(final String[] pStrArray)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; public class Main { /** line separator. */ private static final String LINE_SEPARATOR = System.lineSeparator(); public static String implode(final String[] pStrArray) { return implode(pStrArray, "\t"); }//ww w. j a v a2s. c o m public static String implode(final Object[] pieces, final String glue) { final StringBuilder buf = new StringBuilder(110); for (int i = 0; i < pieces.length; i++) { if (0 < i) { buf.append(glue); } buf.append(pieces[i].toString()); } return buf.toString(); } public static String implode(final Iterable<?> pieces) { return implode(pieces, LINE_SEPARATOR); } public static String implode(final Iterable<?> pieces, final String glue) { if (pieces == null) { return ""; } final StringBuilder resBuf = new StringBuilder(100); final Iterator<?> iter = pieces.iterator(); resBuf.append(iter.next().toString()); while (iter.hasNext()) { resBuf.append(glue); resBuf.append(iter.next().toString()); } return resBuf.toString(); } }