集合转 String 通用方法
public static String collectionToStrings(Collection collection) {
StringBuilder builder = new StringBuilder();
if (collection != null && collection.size() > 0){
for (Iterator ite = collection.iterator(); ite.hasNext(); builder.append(",")){
builder.append(ite.next());
builder.deleteCharAt(builder.length() - 1);
}
}
return builder.toString();
}
--------
--------------------------------
作者:梓晓
原文:https://blog.csdn.net/waterdemo/article/details/43603317
网友评论