Here you can find the source of join(String spliter, Object[] arr)
public static String join(String spliter, Object[] arr)
//package com.java2s; public class Main { public static String join(String spliter, Object[] arr) { if (arr == null || arr.length == 0) { return ""; }/*w w w. ja va 2 s.c o m*/ if (spliter == null) { spliter = ""; } StringBuilder builder = new StringBuilder(); for (int i = 0; i < arr.length; i++) { if (i == arr.length - 1) { break; } if (arr[i] == null) { continue; } builder.append(arr[i].toString()); builder.append(spliter); } return builder.toString(); } }