Here you can find the source of joinStrings(String joiner, Iterable
public static String joinStrings(String joiner, Iterable<String> parts)
//package com.java2s; public class Main { public static String joinStrings(String joiner, Iterable<String> parts) { StringBuilder builder = new StringBuilder(); boolean first = true; for (String part : parts) { if (!first) { builder.append(joiner);/*from w w w . ja v a2 s. co m*/ } builder.append(part); first = false; } return builder.toString(); } }