Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

public class Main {
    public static String join(List<String> values, String string) {

        StringBuilder sb = new StringBuilder();
        int c = values.size();
        for (String val : values) {
            if (c-- > 1)
                sb.append(val + string);
            else
                sb.append(val);

        }
        return sb.toString();
    }
}