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
In Java8, using anyMatch
List list = Arrays.asList("XYZ", "ABC"); String matchingText = "xYz"; boolean isMatched = list.stream().anyMatch(matchingText::equalsIgnoreCase);