Java List Join join(List arr, String seperator)

Here you can find the source of join(List arr, String seperator)

Description

join

License

Open Source License

Declaration

public static String join(List<?> arr, String seperator) 

Method Source Code


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

import java.util.List;

public class Main {
    public static String join(List<?> arr, String seperator) {
        StringBuilder str = new StringBuilder();
        boolean isFirst = true;
        for (Object item : arr) {
            if (!isFirst) {
                str.append(seperator);//  w  w  w  . j  a  v  a 2 s .  co  m
            }
            str.append(item);
            isFirst = false;
        }
        return str.toString();
    }
}

Related

  1. join(List olist, String glue)
  2. join(List valueList, String separator)
  3. join(List words, String iDelimiter)
  4. join(List list, T element)
  5. join(List _items, String _delim)
  6. join(List items, char separator)
  7. join(List items, String delimiter)
  8. join(List list)
  9. join(List list, String delim)