Java Collection Combine combine(Collection strings)

Here you can find the source of combine(Collection strings)

Description

combine

License

LGPL

Declaration

private static String combine(Collection<String> strings) 

Method Source Code

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

import java.util.Collection;
import java.util.Iterator;

public class Main {
    private static String combine(Collection<String> strings) {
        Iterator<String> iter = strings.iterator();
        if (!iter.hasNext()) {
            return "";
        }/*from   w ww.ja v  a 2 s  .  c  om*/
        String rtrn = iter.next();
        while (iter.hasNext()) {
            rtrn += "_" + iter.next();
        }
        return rtrn;
    }
}

Related

  1. combine(Collection first, Collection second)
  2. combine(Collection... collections)
  3. combine(final Collection[] c)
  4. combine(String separator, Collection parts)
  5. combine(String separator, Collection stringCollection)
  6. combine(String separator, Collection objs)