去重

LIst去重

List deptList=new ArrayList<>();

        for (String string : list) {

        String deptLeaderId = systemRemoteService.getUserDepartmentLeaderIdUserId(string);

        if(!deptList.contains(deptLeaderId)) {

        deptList.add(deptLeaderId);

        }

        }


String 去重

String str=“”;

str。indexOf();//返回一个int值

你可能感兴趣的:(去重)