/**
* list 转 string 逗号拼接
*/
public static String listToString(List<String> list) {
if (list == null) {
return null;
}
return String.join(",", list);
}
/**
* string 转 list
*/
public static List<String> stringToList(String strs) {
return Arrays.asList(strs.split(","));
}
String和List间的相互转换
最新推荐文章于 2024-03-24 10:59:17 发布