Java Collection Join join(String joiner, Collection strings)

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

Description

join

License

LGPL

Declaration

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

Method Source Code

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

import java.util.Collection;

public class Main {
    public static String join(String joiner, Collection<String> strings) {
        if (strings == null)
            return null;
        StringBuffer buffer = new StringBuffer();
        for (String string : strings) {
            if (buffer.length() > 0) {
                buffer.append(joiner);//from  w  ww. j a  va  2  s.c o  m
            }
            buffer.append(string);
        }
        return buffer.toString();
    }
}

Related

  1. join(String glue, Collection pieces)
  2. join(String glue, Collection c)
  3. join(String glue, Collection strings)
  4. join(String glue, Collection items)
  5. join(String join_string, Collection c)
  6. join(String sep, Collection objects)
  7. join(String sep, Collection col)
  8. join(String sep, Collection col)
  9. join(String sep, Collection parts)