Here you can find the source of listToString(List list, char sep)
Parameter | Description |
---|---|
list | a parameter |
sep | a parameter |
public static String listToString(List list, char sep)
//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(); } }