Here you can find the source of merge(String[] pieces, String sep)
static public String merge(String[] pieces, String sep)
//package com.java2s; /* Copyright 2012, UCAR/Unidata. See the LICENSE file for more information. */ public class Main { static public String merge(String[] pieces, String sep) { if (pieces == null) return ""; StringBuilder buf = new StringBuilder(); for (int i = 0; i < pieces.length; i++) { if (i > 0) buf.append(sep);/*from w w w. j a v a2s .c o m*/ buf.append(pieces[i]); } return buf.toString(); } }