Java ArrayList Join joinList(ArrayList list, String joint)

Here you can find the source of joinList(ArrayList list, String joint)

Description

join List

License

Open Source License

Declaration

private static String joinList(ArrayList<String> list, String joint) 

Method Source Code

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

import java.util.ArrayList;

public class Main {
    private static String joinList(ArrayList<String> list, String joint) {
        StringBuilder joinedList = new StringBuilder();
        for (String item : list) {
            joinedList.append(item);/* ww w  .  j a v a 2s .c o m*/
            joinedList.append(joint);
        }
        if (joinedList.length() > 0)
            joinedList.setLength(joinedList.length() - 1);
        return joinedList.toString();
    }
}

Related

  1. join(final ArrayList parts, final char separator)
  2. join(String glue, ArrayList a)
  3. joinArrayList(List coll, String delimiter)
  4. joinArrayList(String joiner, ArrayList array)
  5. joinCommandLine(ArrayList lsCmdl)