Here you can find the source of join(T[] objs, String splitString)
public static <T> String join(T[] objs, String splitString)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static <T> String join(T[] objs, String splitString) { return join(objs, 0, objs.length, splitString); }//from www .j a v a 2 s .c o m public static <T> String join(T[] objs, int start, int end, String splitString) { StringBuilder s = new StringBuilder(); for (int i = start; i < end; i++) { if (i != start) { s.append(splitString); } s.append(objs[i]); } return s.toString(); } public static String join(List<?> objList, String splitString) { return join(objList, 0, objList.size(), splitString); } public static String join(List<?> objList, int start, int end, String splitString) { StringBuilder s = new StringBuilder(); for (int i = start; i < end; i++) { if (i != start) { s.append(splitString); } s.append(objList.get(i)); } return s.toString(); } public static <T> String join(List<T[]> objList, int columnIndex, String splitString) { StringBuilder s = new StringBuilder(); if (objList.size() > 0) { s.append(objList.get(0)[columnIndex]); for (int i = 1, ii = objList.size(); i < ii; i++) { s.append(splitString).append(objList.get(i)[columnIndex]); } } return s.toString(); } }