I am currently using the contains method belonging to the ArrayList class for making a search. Is there a way to make this search case insensitive in java? I found that in C
Looking at the Java API, there is no such method for contains.
But you could do at least two things:
Write your own contains method, which should iterate through your ArrayList entities, and do a manual check.
ArrayList list = new ArrayList();
...
containsIgnoreCase("a", list);
public boolean containsIgnoreCase(String str, ArrayList list){
for(String i : list){
if(i.equalsIgnoreCase(str))
return true;
}
return false;
}