Java List Join join(List strings, String joiner)

Here you can find the source of join(List strings, String joiner)

Description

join

License

Apache License

Declaration

public static String join(List<String> strings, String joiner) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static String join(List<String> strings, String joiner) {
        if (strings.isEmpty())
            return "";
        StringBuilder sb = new StringBuilder(strings.get(0));
        for (int i = 1; i < strings.size(); i++)
            sb.append(joiner).append(strings.get(i));
        return sb.toString();
    }/*ww  w .  j  av a2 s .c o  m*/
}

Related

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