Here you can find the source of join(Object[] strings, String spliter)
public static String join(Object[] strings, String spliter)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static String join(Object[] strings, String spliter) { int i = 0; StringBuffer buffer = new StringBuffer(); for (Object s : strings) { if (i == 0) { buffer.append(s);/*from ww w . j a v a 2 s . c o m*/ i = 1; } else { buffer.append(spliter + s); } } return buffer.toString(); } public static String join(int[] strings, String spliter) { int i = 0; StringBuffer buffer = new StringBuffer(); for (Object s : strings) { if (i == 0) { buffer.append(s); i = 1; } else { buffer.append(spliter + s); } } return buffer.toString(); } public static String join(byte[] strings, String spliter) { int i = 0; StringBuffer buffer = new StringBuffer(); for (Object s : strings) { if (i == 0) { buffer.append(s); i = 1; } else { buffer.append(spliter + s); } } return buffer.toString(); } public static String join(List<String> strings, String spliter) { return join(strings.toArray(), spliter); } }