Java List to String ListToString(List lista)

Here you can find the source of ListToString(List lista)

Description

List To String

License

Apache License

Declaration

public static String ListToString(List<? extends Object> lista) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static String ListToString(List<? extends Object> lista) {
        if (lista != null)
            return lista.toString().replaceAll("\\[", "")
                    .replaceAll("\\]", "");
        else//  ww  w . ja  v a2 s . co m
            return "";
    }

    /**
     * Transforma um objeto em String<br>
     * Caso obj seja nulo retorna nulo.
     * 
     * @param obj
     * @return
     */
    public static String toString(Object obj) {
        return obj != null ? obj.toString() : null;
    }
}

Related

  1. listToString(List list, String prefix, String suffix, String separator)
  2. listToString(List list)
  3. listToString(List list)
  4. listToString(List list, String delim)
  5. listToString(List list, String header, String separator, String footer)
  6. listToString(List collection)
  7. listToString(List items)
  8. listToString(List l, String delim)
  9. listToString(List l, String sep)