Java Collection Concatenate concat(String[] first, Collection second)

Here you can find the source of concat(String[] first, Collection second)

Description

concat

License

Open Source License

Declaration

public static String[] concat(String[] first, Collection<String> second) 

Method Source Code

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

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

public class Main {
    public static String[] concat(String[] first, Collection<String> second) {
        String[] array = Arrays.copyOf(first, first.length + second.size());
        Iterator<String> it = second.iterator();
        for (int i = first.length; i < array.length; i++)
            array[i] = it.next();//from  w  ww.  j  a  va2  s.c o m
        return array;
    }
}

Related

  1. concat(Collection first, Collection second)
  2. concat(Collection... collections)
  3. concat(final Collection... collections)
  4. concat(final Collection... collections)
  5. concat(String separator, Collection args)
  6. concatCollection(Collection collection)
  7. concatElements(final Collection c, final String separator)
  8. concatenate(Collection collections)
  9. concatenate(Collection coll)