集合转 String 通用方法
2018-11-30 本文已影响0人
蒲熠星F1
集合转 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