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

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

Description

list To String

License

LGPL

Declaration

public static String listToString(List<String> list, String expr) 

Method Source Code


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

import java.util.List;

public class Main {

    public static String listToString(List<String> list, String expr) {
        String strInfo = "";
        if (list != null && list.size() > 0) {
            StringBuffer sf = new StringBuffer();
            for (String str : list) {
                sf.append(str);/* ww w.  j  a  va2 s  .c o  m*/
                sf.append(expr);
            }
            strInfo = sf.substring(0, sf.length() - 1);
        }
        return strInfo;
    }
}

Related

  1. listToString(List list)
  2. listToString(List list)
  3. listToString(List list)
  4. listToString(List list)
  5. listToString(List list, String delimiter)
  6. listToString(List list, String separator)
  7. listToString(List list, String separator)
  8. listToString(List list, String separator)
  9. listToString(List list, String split)