Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.util.Collection;

public class Main {
    public static final String join(final Collection<?> list, final String inbetween) {
        final StringBuilder builder = new StringBuilder();
        for (final Object object : list) {
            if (builder.length() > 0) {
                builder.append(inbetween);
            }
            builder.append(object.toString());
        }
        return builder.toString();
    }
}