我有Set<String> result
& 想将其转换为逗号分隔的字符串。我的方法如下所示,但也在寻找其他意见。
List<String> slist = new ArrayList<String> (result);
StringBuilder rString = new StringBuilder();
Separator sep = new Separator(", ");
//String sep = ", ";
for (String each : slist) {
rString.append(sep).append(each);
}
return rString;