Java List Print printStringList(List listToPrint)

Here you can find the source of printStringList(List listToPrint)

Description

Prints the elements of a string list without leading and ending brackets.

License

Open Source License

Parameter

Parameter Description
listToPrint the list to print.

Return

a string as a list of elements without leading and ending brackets.

Declaration

public static String printStringList(List<String> listToPrint) 

Method Source Code

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

import java.util.List;

public class Main {
    /**//from w  w w. ja v  a2 s  . com
     * Prints the elements of a string list without leading and ending brackets.
     * 
     * @param listToPrint
     *            the list to print.
     * @return a string as a list of elements without leading and ending
     *         brackets.
     */
    public static String printStringList(List<String> listToPrint) {
        return listToPrint.toString().replace("[", "").replace("]", "").trim();
    }
}

Related

  1. printPerformanceStats(String message, List iterationTimesInNanoseconds)
  2. printQueryResults(List res)
  3. printRules(List rules, Class clazz)
  4. printStats(final List shocktimes)
  5. printStringList(List list, String name)
  6. printStringList(List strings)
  7. printTable(List data)
  8. printTopNTokens(LinkedList> list, int n)
  9. printTuple(List tuple)

    HOME | Copyright © www.java2s.com 2016