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
If you don't want to create a new function, you can try this method:
List myList = new ArrayList(); //The list you're checking
String wordToFind = "Test"; //or scan.nextLine() or whatever you're checking
//If your list has mix of uppercase and lowercase letters letters create a copy...
List copyList = new ArrayList();
for(String copyWord : myList){
copyList.add(copyWord.toLowerCase());
}
for(String myWord : copyList){
if(copyList.contains(wordToFind.toLowerCase()){
//do something
}
}