如何将list转换为string以逗号隔开

如何将list转换为string以逗号隔开

list1 = com.founder.core.util.UimUtils.getUserIdByRoleId(10017);
String genManager1 = Joiner.on(",").join(list1);
list2 = com.founder.core.util.UimUtils.getUserIdByRoleId(10018);
String genManager2 = Joiner.on(",").join(list2);
String str[] = { genManager1,genManager2 };
StringBuffer buf = new StringBuffer();
for (int i = 0; i < str.length; i++) {
buf.append(str[i]).append(",");
}
String genManager = buf.toString();

你可能感兴趣的:(工作总结)