@Test
public void testHh() {
List<String> idList = new ArrayList<>();
idList.add("10");
idList.add("11");
idList.add("12");
idList.add("13");
idList.add("14");
idList.add("15");
idList.add("16");
String[] split = new String[3];
split[0] = "14";
split[1] = "10";
split[2] = "16";
int count = 0;
if (split != null && split.length > 0) {
for (String id : split) {
if (idList.contains(id)) {
count++;
} else {
count = -1;
}
}
if (count == -1) {
System.out.println("集合没有包含数组所有数据");
} else if (count == split.length) {
System.out.println("集合包含数组所有数据");
}
}
}
网友评论