Javalist转成String

xiaoxiao2021-03-01  15

public static <T extends Object> String listToString(List<T> list){ StringBuilder sb=new StringBuilder(); for(T item : list){ if(sb.length()==0) { sb.append(item.toString()); } else { sb.append(","+item.toString()); } } return sb.toString(); }
转载请注明原文地址: https://www.6miu.com/read-3650276.html

最新回复(0)