Java List Concatenate concatinateStrings(List strList, String delim)

Here you can find the source of concatinateStrings(List strList, String delim)

Description

concatinate Strings

License

BSD License

Declaration

public static String concatinateStrings(List<String> strList, String delim) 

Method Source Code

//package com.java2s;
/*L//  w  w  w.j  av a 2  s  .c om
 *  Copyright SAIC
 *
 *  Distributed under the OSI-approved BSD 3-Clause License.
 *  See http://ncip.github.com/stats-application-commons/LICENSE.txt for details.
 */

import java.util.Iterator;
import java.util.List;

public class Main {
    public static String concatinateStrings(List<String> strList, String delim) {
        StringBuffer sb = new StringBuffer();
        for (Iterator i = strList.iterator(); i.hasNext();) {
            sb.append(i.next());
            if (i.hasNext())
                sb.append(delim);
        }
        return sb.toString();
    }
}

Related

  1. concatenateLists(List... lists)
  2. concatenateParameters(List parameters)
  3. concatenateStrings(List strings, String separator)
  4. concatenateUniqueLists(List first, List second)
  5. concatGenericList(List list, String delimiter)
  6. concatIntegersToRanges( List damages)
  7. concatLines(List lines)
  8. concatLines(List lines)
  9. concatLineSeparated(List discountCommentCauseList)