Java List Join join(List list, String delimiter)

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

Description

join

License

Open Source License

Declaration

static String join(List<String> list, String delimiter) 

Method Source Code


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

import java.util.List;

public class Main {
    static String join(List<String> list, String delimiter) {
        StringBuilder sb = new StringBuilder();
        int size = list.size();
        for (int i = 0; i < size; i++) {
            sb.append(list.get(i)).append(i < size - 1 ? delimiter : "");
        }/*from w w  w  . ja v a  2s  . c o  m*/
        return sb.toString();
    }
}

Related

  1. join(List list)
  2. join(List list)
  3. join(List list, String conjunction)
  4. join(List list, String delim)
  5. join(List list, String delim)
  6. join(List list, String delimiter)
  7. join(List list, String delimiter)
  8. join(List list, String sep)
  9. join(List list, String separator)