Java List from listOfStrToString(List src, String del)

Here you can find the source of listOfStrToString(List src, String del)

Description

list Of Str To String

License

Open Source License

Declaration

public static String listOfStrToString(List<String> src, String del) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String listOfStrToString(List<String> src, String del) {
        StringBuilder sb = new StringBuilder();
        for (String s : src)
            sb.append(s + del);//from   w  w  w.  ja v a 2  s  . com
        src.clear();
        src = null;
        return sb.toString();
    }

    public static String listOfStrToString(List<String> src, String del, boolean hasDelAtEdn) {

        StringBuilder sb = new StringBuilder();
        for (String s : src)
            sb.append(s + del);
        if (!hasDelAtEdn)
            sb.setLength(sb.length() - del.length());
        src.clear();
        src = null;
        return sb.toString();
    }
}

Related

  1. listOfIntegers2ArrayOfInts(List xs)
  2. listOfItems(List items, String separator, String finalConjunction)
  3. listOfOne()
  4. listOfOne(T x)
  5. listOfStrings(int size, String prefix)