Java List Join join(List list, String separator)

Here you can find the source of join(List list, String separator)

Description

join

License

Open Source License

Declaration

public static String join(List<String> list, String separator) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String join(List<String> list, String separator) {
        String joined = "";
        for (String s : list) {
            joined += s + separator;//from ww  w  .  ja  v  a2 s  .  c om
        }
        joined = !list.isEmpty() ? joined.substring(0, joined.length() - separator.length()) : joined;
        return joined;
    }
}

Related

  1. join(List list, String delim)
  2. join(List list, String delimiter)
  3. join(List list, String delimiter)
  4. join(List list, String delimiter)
  5. join(List list, String sep)
  6. join(List list, String separator)
  7. join(List list1, List list2)
  8. join(List list1, List list2)
  9. join(List lst, int start, int end)