动态减list中的数据,及字符串数组赋值给list

1、list冬天减数据

List<String> list = new ArrayList<>();

Iterator<String> it = list.iterator();

while(it.hasNext()){

  String ss = it.next();

  if(ss.indexOf("aa")>-1){

    it.remove();

  }

}

2、字符串数组赋值给list

String ss = "aaa,bbb,ccc,ddd";

String[] arr = ss.split(",");

List<String> inlist = Arrays.asList(arr);

posted @ 2019-11-09 13:01  jassy  阅读(428)  评论(0编辑  收藏  举报