Here you can find the source of join(String delimiter, String[] strings)
public static String join(String delimiter, String[] strings)
//package com.java2s; public class Main { public static String join(String delimiter, String[] strings) { if (strings.length == 0) { return ""; }// www.ja va 2 s .c o m StringBuilder stringBuilder = new StringBuilder(); for (String str : strings) { stringBuilder.append(" ").append(str); } return stringBuilder.substring(1); } public static String join(int[] arr, String delimiter) { if (arr.length == 0) { return ""; } StringBuilder sb = new StringBuilder(); for (int i : arr) { sb.append(delimiter).append(Integer.toString(i)); } return sb.substring(delimiter.length()); } }