Java List to String listToString(List list, char sep)

Here you can find the source of listToString(List list, char sep)

Description

list To String

License

Open Source License

Parameter

Parameter Description
list a parameter
sep a parameter

Declaration

public static String listToString(List list, char sep) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    /**/*from   w w w.  j  a  v  a  2  s .c  o m*/
     * 
     * @param list
     * @param sep
     * @return
     */
    public static String listToString(List list, char sep) {
        StringBuffer buffer = new StringBuffer();
        if (list != null) {
            for (int i = 0; i < list.size(); i++) {
                if (buffer.length() > 0) {
                    buffer.append(sep);
                }
                buffer.append(list.get(i));
            }
        }
        return buffer.toString();
    }
}

Related

  1. listToString(List l)
  2. listToString(List l)
  3. listToString(List list)
  4. listToString(List list)
  5. listToString(List list)
  6. listToString(List list, String delim)
  7. listToString(List list, String glue)
  8. listToString(List list, String prefix, String suffix, String separator)
  9. listToString(List list)