Java List Join join(List list, String delim)

Here you can find the source of join(List list, String delim)

Description

join

License

Open Source License

Declaration

public static String join(List list, String delim) 

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 join(List list, String delim) {
        if (list == null || list.size() < 1)
            return null;
        StringBuffer buf = new StringBuffer();
        Iterator i = list.iterator();
        while (i.hasNext()) {
            buf.append((String) i.next());
            if (i.hasNext())
                buf.append(delim);/*  ww  w. ja  va 2  s. c  o  m*/
        }
        return buf.toString();
    }
}

Related

  1. join(List elements, String joinWith)
  2. join(List elements, String sep)
  3. join(List items, String separator)
  4. join(List l, String sep)
  5. join(List list, char separator)
  6. join(List list, String delimiter)
  7. join(List list, String flag)
  8. join(List list, String separator)
  9. join(List list, String separator)