----------
比较2个列表,找出列表中不同的元素,再返回
List<String> oldList;
List<String> newList;
for(String str : newList){
if(oldList.contains(str )){
oldList.remove(str );
}
}
然后返回oldList就ok了
比较2个列表中不相同部分放到新列表返回
最新推荐文章于 2022-07-25 22:18:45 发布
----------
比较2个列表,找出列表中不同的元素,再返回
List<String> oldList;
List<String> newList;
for(String str : newList){
if(oldList.contains(str )){
oldList.remove(str );
}
}
然后返回oldList就ok了