Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Collection;

public class Main {
    public static String join(Collection<String> c, String sep) {
        StringBuilder sb = new StringBuilder();
        boolean seenFirst = false;
        for (String e : c) {
            if (seenFirst) {
                sb.append(sep);
            } else {
                seenFirst = true;
            }
            sb.append(e);
        }
        return sb.toString();
    }
}