Java List Join join(List items, CharSequence delimiter)

Here you can find the source of join(List items, CharSequence delimiter)

Description

join

License

Open Source License

Declaration

public static String join(List<? extends CharSequence> items, CharSequence delimiter) 

Method Source Code


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

import java.util.List;

public class Main {
    public static String join(List<? extends CharSequence> items, CharSequence delimiter) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < items.size(); i++) {
            if (i != 0)
                sb.append(delimiter);/* www  .ja  v a 2 s .co  m*/
            sb.append(items.get(i));
        }
        return sb.toString();
    }
}

Related

  1. join(List list, String separator)
  2. join(List objects)
  3. join(List objects, String joiner)
  4. join(List strings, String delimiter)
  5. join(List vec, String separator)
  6. join(List s, String delimiter)
  7. join(List s, String delimiter)
  8. join(List items, String conjunction)
  9. join(List items, String separator)