Here you can find the source of merge(String[] list)
public static String merge(String[] list)
//package com.java2s; // it under the terms of the GNU Affero General Public License as published by import java.util.Arrays; import java.util.List; public class Main { public static String merge(String[] list) { return merge(Arrays.asList(list)); }/*from w ww . j av a 2s .co m*/ public static String merge(List<String> list) { return doMerge(list, "\n"); } private static String doMerge(List<String> list, String sep) { StringBuilder builder = new StringBuilder(); for (String s : list) { builder.append(s); builder.append(sep); } return builder.toString(); } }