字符串转list
/**
* 字符串转list
*/
public static List<String> strSplitToList(String str, String regex) {
List<String> list = new ArrayList<>();
if (str != null) {
if (str.contains(regex)) {
Collections.addAll(list, str.split(regex));
} else {
list.add(str);
}
}
return list;
}
实现List集合中数据逆序排列
Collections.reverse(list); 实现list集合逆序排列