Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static String convertSetToString(LinkedHashSet<String> set) {
        int length = set.size();
        StringBuilder sb = new StringBuilder();
        for (String item : set) {
            length--;
            sb.append(item);
            if (length != 0) {
                sb.append(",");
            }
        }
        return sb.toString();
    }
}