Java List to String listToString(String itemName, List list)

Here you can find the source of listToString(String itemName, List list)

Description

list To String

License

Apache License

Declaration

private static String listToString(String itemName, List list) 

Method Source Code

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

import java.util.*;

public class Main {
    private static String listToString(String itemName, List list) {
        StringBuffer buffer = new StringBuffer("\n\t< " + itemName + " >\n");
        Iterator iterator = list.iterator();

        for (; iterator.hasNext();) {
            buffer.append("\t\t< ").append(iterator.next().toString()).append(" >\n");
        }//from w  w w .  j  av a2s  .c  o m

        buffer.append("\t< " + itemName + " >");
        return buffer.toString();
    }
}

Related

  1. listToString(List list)
  2. listToString(List list)
  3. listToString(List list)
  4. listToString(List list, String prefix, String delimiter, String suffix)
  5. listToString(List list, String sep)
  6. toString(final List list)
  7. toString(final List list, final String separtor)
  8. toString(final List list)
  9. toString(final List inMessages)