Java List Concatenate concatList(List list)

Here you can find the source of concatList(List list)

Description

concat List

License

Open Source License

Declaration

public static String concatList(List<? extends Object> list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static String concatList(List<? extends Object> list) {
        return concatList(list, "\n");
    }/* w  w w .  j av a  2s .com*/

    public static String concatList(List<? extends Object> list, String c) {
        String r = "";

        for (Object o : list) {
            r += o.toString() + c;
        }

        return r;
    }

    public static String concatList(String l[]) {
        return concatList(l, "\n");
    }

    public static String concatList(String l[], String c) {
        List<String> tmp = new ArrayList<String>();
        for (int i = 0; i < l.length; i++) {
            if (l[i] != null)
                tmp.add(l[i]);
        }

        return concatList(tmp, c);
    }
}

Related

  1. concatinateStrings(List strList, String delim)
  2. concatIntegersToRanges( List damages)
  3. concatLines(List lines)
  4. concatLines(List lines)
  5. concatLineSeparated(List discountCommentCauseList)
  6. concatList(List... array)
  7. concatList(List strings)
  8. concatListToString(List suggestedList)
  9. concatName(String name, List names)