Java List to String listToString(List collection)

Here you can find the source of listToString(List collection)

Description

Formats a collection of Jatalog entities, like Expr s and Rule s

License

Apache License

Parameter

Parameter Description
collection the collection to convert to a string

Return

A String representation of the collection.

Declaration

public static String listToString(List<?> collection) 

Method Source Code

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

import java.util.List;

public class Main {
    /**//from  w ww. j  a v a 2s.  co  m
     * Formats a collection of Jatalog entities, like {@link Expr}s and {@link Rule}s
     * @param collection the collection to convert to a string
     * @return A String representation of the collection.
     */
    public static String listToString(List<?> collection) {
        StringBuilder sb = new StringBuilder("[");
        for (Object o : collection)
            sb.append(o.toString()).append(". ");
        sb.append("]");
        return sb.toString();
    }
}

Related

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