Java ArrayList Join joinArrayList(String joiner, ArrayList array)

Here you can find the source of joinArrayList(String joiner, ArrayList array)

Description

join Array List

License

Open Source License

Declaration

public static String joinArrayList(String joiner, ArrayList<String> array) 

Method Source Code


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

import java.util.ArrayList;

public class Main {
    public static String joinArrayList(String joiner, ArrayList<String> array) {
        String result = "";
        for (int i = 0; i < array.size(); i++) {
            result += array.get(i);/*  w w w  . j  a  v a2s. co m*/
            if (i < array.size() - 1) {
                result += joiner;
            }
        }
        return result;
    }
}

Related

  1. join(final ArrayList array, final String separator)
  2. join(final ArrayList arry, final String with)
  3. join(final ArrayList parts, final char separator)
  4. join(String glue, ArrayList a)
  5. joinArrayList(List coll, String delimiter)
  6. joinCommandLine(ArrayList lsCmdl)
  7. joinList(ArrayList list, String joint)