Here you can find the source of split(Collection> collections, String separator)
public static String split(Collection<?> collections, String separator)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static String split(Collection<?> collections, String separator) { Object[] array = collections.toArray(new Object[0]); int length = array.length; StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < length; i++) { stringBuilder.append(array[i]); if (i != length - 1) { stringBuilder.append(separator); }//from ww w . j a v a 2 s .co m } return stringBuilder.toString(); } }