Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static <A> String join(Iterable<A> combination, String sep) { StringBuilder sb = new StringBuilder(); for (A s : combination) { if (sb.length() > 0) { sb.append(sep); } sb.append(s); } return sb.toString(); } }