Java tutorial
//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(); } }