Here you can find the source of merge(String array[], String delimiter)
public static String merge(String array[], String delimiter)
//package com.java2s; //License from project: Apache License public class Main { public static String merge(String array[], String delimiter) { if (array == null) { return null; }//from w w w.j a v a 2 s . c o m StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { sb.append(array[i].trim()); if ((i + 1) != array.length) { sb.append(delimiter); } } return sb.toString(); } }