Java Comma Separated List getAsCommaDelimitedString(List coll)

Here you can find the source of getAsCommaDelimitedString(List coll)

Description

get As Comma Delimited String

License

Open Source License

Declaration

public static String getAsCommaDelimitedString(List<?> coll) 

Method Source Code


//package com.java2s;

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

public class Main {
    public static String getAsCommaDelimitedString(List<?> coll) {
        StringBuffer strBuffer = new StringBuffer();
        for (Iterator<?> iter = coll.iterator(); iter.hasNext();) {
            Object obj = iter.next();
            if (obj != null) {
                strBuffer.append(obj.toString());
                strBuffer.append(",");
            }/*from   w  w  w.  j  a v  a2s.  c o  m*/
        }
        return strBuffer.toString();
    }
}

Related

  1. ConvertDiscussionGroupListToCommaString( List list)
  2. convertToStringList(String valuesCommaSeparated)
  3. extractCommaItems(List list, String tags)
  4. extractCommandsFromLine(final String line, final String delimiter, final StringBuilder bufferedCommand, final List extractedCommands)
  5. formatCommand(List arguments)
  6. getCommaList(List V)
  7. getCommandLine(List command)
  8. getCommandLineOptionInt(List args, String param, int defaultValue)
  9. getCommandStr(List commandList)