Java List Merge merge(String[] list)

Here you can find the source of merge(String[] list)

Description

merge

License

Open Source License

Declaration

public static String merge(String[] list) 

Method Source Code

//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();
    }
}

Related

  1. merge(List a, List b)
  2. merge(List a, List b, Comparator comp)
  3. merge(List list)
  4. merge(List list, int split)
  5. merge(List list, List items)
  6. merge2ListsWithoutDup(List list1, List list2)
  7. mergeBandY(List A, int z, int y, int yn)
  8. mergeBytes(List packages)
  9. mergeCollectionsToList(Collection... cols)