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 convertToString(Collection<String> strings, String delimiter) {
        if (strings != null) {
            StringBuilder result = new StringBuilder();
            for (String string : strings) {
                result.append(string);
                result.append(delimiter);
            }
            return result.substring(0, result.length() - 1);
        }
        return null;
    }
}