Java List to Int List listToInString(List list)

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

Description

list To In String

License

Open Source License

Declaration

public static String listToInString(List list) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String listToInString(List list) {
        if (list == null || list.size() == 0)
            return null;
        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < list.size(); i++) {
            Object obj = list.get(i);
            if (obj != null && obj.toString().length() != 0) {
                if (i != 0)
                    buf.append(", ");
                buf.append("'" + obj.toString() + "'");
            }/*from w  w  w .  j  av a2 s .  c o  m*/
        }
        return buf.toString();
    }
}

Related

  1. listToIntArray(final List ints)
  2. listToIntArray(List l)
  3. listToIntArray(List list)
  4. listToIntegerArray(List list)