Java Collection Join join(Collection collection)

Here you can find the source of join(Collection collection)

Description

join

License

Open Source License

Declaration

public static String join(Collection<String> collection) 

Method Source Code


//package com.java2s;
/*/*from  w  w  w  . j a v  a  2 s  . c o m*/
 * @(#)CollectionUtils.java 2013-4-3 ????23:33:33
 *
 * Copyright (c) 2011-2013 Makersoft.org all rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 */

import java.util.Collection;

public class Main {
    public static String join(Collection<String> collection) {
        if (collection != null && collection.size() != 0) {
            StringBuffer sb = new StringBuffer();
            for (String item : collection) {
                sb.append(item);
            }

            return sb.toString();
        }

        return null;
    }
}

Related

  1. join(Collection c)
  2. join(Collection c, String joinSymbol)
  3. join(Collection coll, String delimiter)
  4. join(Collection coll, String delimiter)
  5. join(Collection collection)
  6. join(Collection collection, String separator)
  7. join(Collection collection, String separator)
  8. join(Collection collection, String separator)
  9. join(Collection collection, String separator)