Java List Concatenate concat(List list)

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

Description

concat

License

Open Source License

Declaration

public static String concat(List list) 

Method Source Code

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

import java.util.Iterator;
import java.util.List;

public class Main {
    public static String concat(List list) {
        if (list.size() > 0) {
            final StringBuilder result = new StringBuilder();
            Iterator iter = list.iterator();
            while (iter.hasNext()) {
                result.append(iter.next().toString());
                if (iter.hasNext()) {
                    result.append(".");
                }// w  w w.  j a v a 2s .c om
            }
            return result.toString();
        } else {
            return "";
        }
    }
}

Related

  1. concat(Collection> lists)
  2. concat(Collection list1, Collection list2)
  3. concat(final byte[] result, final List buffers)
  4. concat(final Collection... lists)
  5. concat(final List list1, final List list2)
  6. concat(List l1, List l2)
  7. concat(List list1, List list2)
  8. concat(List list, String delim)
  9. concat(List lista, List listb)