ArrayList arrayList = new ArrayList();
arrayList.add("I");
arrayList.add("Love");
arrayList.add("You");
String check = "Lo";
for (int i = 0; i < arrayList.size(); i++){
if (arrayList.get(i).toString().indexOf(check) != -1) {
System.out.println(arrayList.get(i));
}
}
网友评论