If you're using Java 8

List<String> list = new ArrayList<>();

boolean containsSearchStr = list.stream().anyMatch("search_value"::equalsIgnoreCase);
Answer from Nivas Mane-Patil on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › java string › case-insensitive searching in arraylist
Case-Insensitive Searching in ArrayList | Baeldung
March 7, 2025 - If this is the case, we probably want to create a particular ArrayList<String> type, which supports the case-insensitive contains() method natively. So next, let’s create a subclass of ArrayList<String>: public class IgnoreCaseStringList extends ArrayList<String> { public IgnoreCaseStringList() { } public IgnoreCaseStringList(Collection<? extends String> c) { super(c); } @Override public boolean contains(Object o) { String searchStr = (String) o; for (String s : this) { if (searchStr.equalsIgnoreCase(s)) { return true; } } return false; } }
Discussions

How To Ignore Case When Comparing ArrayList Elements To String ?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/javahelp
7
4
December 9, 2022
java - Checking if an ArrayList contains a certain String while being case insensitive - Stack Overflow
How can i search through an ArrayList using the .contains method while being case insensitive? I've tried .containsIgnoreCase but found out that the IgnoreCase method only works for Strings. Here'... More on stackoverflow.com
🌐 stackoverflow.com
December 12, 2016
java - Array contains() without case sensitive lookup? - Stack Overflow
Can I somehow tell the array.contains() method to not make the lookup case sensitive? List data = Arrays.asList( "one", Two", "tHRee"); //lots of entries (100+) data.contains("three"); ... The duplicate is for .NET not Java.. More on stackoverflow.com
🌐 stackoverflow.com
java - ArrayList contains case sensitivity - Stack Overflow
Would compare two different sets ignoring case and return true, in this particular situation and your comparision would work without any issue. ... Looking at the Java API, there is no such method for contains. ... Write your own contains method, which should iterate through your ArrayList entities, and do a manual check. ArrayList list ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Java Code Geeks
examples.javacodegeeks.com › home › java development › core java
Case Insensitive String Handling in Java Lists - Java Code Geeks
February 28, 2024 - If the loop completes without finding a match, the method returns false, indicating that the searchString is not present in the list. To verify whether the containsIgnoreCase() method works as expected, we test it in the main method of the Java ...
🌐
amitph
amitph.com › home › java › case-insensitive search in java arraylists
Case-Insensitive Search in Java ArrayLists - amitph
November 22, 2024 - public static boolean ... false; }Code language: Java (java) The method iterates over the given List and tries to match elements with the given text, ignoring the case....
🌐
Baeldung
baeldung.com › home › java › java list › check if a list contains a string element while ignoring case
Check if a List Contains a String Element While Ignoring Case | Baeldung
March 7, 2025 - Sometimes, we want to case-insensitively check if a string is an element in a string list. In this quick tutorial, we’ll explore various methods and strategies to solve this common problem in Java. List provides the convenient contains() method to check if a given value exists in the list.
🌐
Reddit
reddit.com › r/javahelp › how to ignore case when comparing arraylist elements to string ?
r/javahelp on Reddit: How To Ignore Case When Comparing ArrayList Elements To String ?
December 9, 2022 -
import java.util.ArrayList;

public class WordsCounter {

    public static int occurences(String string, ArrayList<String> words){
        int number = 0;
        for(int i = 0; i < words.size(); i++){
            if(words.get(i).equalsIgnoreCase(string)){
                number++;
            }
        }
        return number;
    }
}

I want to make a method that takes a string and a list of words as parameters, and returns how many of the words in the list could be found in the string at least once. It doesn't have to be the word exactly, just that a part of the string matches, like such:

If the String was "Sunshine is nice", and the list elements were "shine" and "nice", it would return 2.

I can't get it to work with the ignore of case, the program doesn't ignore case despite the method I used. I looked up String methods and equalsIgnoreCase seemed to be a good one but it does not work. I don't know if it's because it can't be applied to list elements (although they are Strings). Do any of you know how I should think regarding this?

Find elsewhere
🌐
Overclock.net
overclock.net › home › forums › software, programming and coding › coding and programming
Java List.Contains -- Case Insensitive? | Overclock.net
June 20, 2008 - Is there a way to use List.Contains(var) in case-insensitive form? E.g. if the list had "LyokoHaCk" and I plugged in "lyokohack" for the variable, it would still return true. I've tried iterating this and converting it to a string array then looping, but no luck! Thanks for the help!
🌐
Roy Tutorials
roytuts.com › home › java › searching an element in java arraylist
Searching an element in Java ArrayList - Roy Tutorials
September 27, 2016 - Case insensitive search · CopyCollapse · package com.roytuts.java.arraylist; import java.util.ArrayList; import java.util.List; public class SearchInArrayListCaseInsensitive { private boolean contains(String str, List<String> list) { for (String s : list) { if (str.equalsIgnoreCase(s)) return true; } return false; } private int indexOf(String str, List<String> list) { if (str != null) { for (int i = 0; i < list.size(); i++) { if (str.equalsIgnoreCase(list.get(i))) { return i; } } } return -1; } public static void main(String[] args) { SearchInArrayListCaseInsensitive insensitive = new SearchInArrayListCaseInsensitive(); List<String> list = new ArrayList<>(); list.add("A"); list.add("B"); list.add("C"); list.add("D"); list.add("E"); boolean found = insensitive.contains("a", list); System.out.println("element a : " + (found ?
🌐
Kotlinlang
slack-chats.kotlinlang.org › t › 8023272 › a-contains-on-list-lt-string-gt-with-caseinsensitive-boolean
a `contains` on `List lt String gt ` with `caseInsensitive B kotlinlang #stdlib
November 30, 2022 - ... we should not be adding new case sensitivity APIs that don't take locale into consideration Locale is currently JVM-only thus, not a great fit for stdlib currently IMO ... equals(ignoreCase = true) does not handle some non-English characters ...
🌐
Educative
educative.io › answers › what-is-stringutilscontainsignorecase-in-java
What is StringUtils.containsIgnoreCase in Java?
containsIgnoreCase is a static method of the StringUtils class that checks whether a given string contains the complete search string as a whole, while ignoring the case considerations.
🌐
Java2Blog
java2blog.com › home › core java › string › java string contains ignore case
Java String contains Ignore Case - Java2Blog
August 26, 2021 - For example, The result is true ... is using a regex pattern to find matching strings. If we use a (?i) argument in the matches method, we make it case-insensitive....
🌐
Websparrow
websparrow.org › home › check hashset contains element case insensitive in java
Check HashSet contains element case insensitive in Java - Websparrow
July 14, 2019 - boolean containsMyCar7 = containMyCarCaseInSensitive(cars, "mAHinDrA"); System.out.println(containsMyCar7); // return true private static boolean containMyCarCaseInSensitive(Set<String> cars, String myCar) { for (String car : cars) { if (car.equalsIgnoreCase(myCar)) { return true; } } return false; } Java introduced Iterator interface in JDK 1.2 version. It is applicable for any Collection implemented classes. For more info check: Java Enumeration, Iterator and ListIterator Example
🌐
Javapedia
javapedia.net › Collections › 586
Does HashSet ignore String case when contains() method is invoked in Java?
HashSet's contains() method is case sensitive and does not allow the use of comparators. We could use TreeSet instead of HashSet which allow Comparator thus facilitating case-insensitive search and comparison. Using the comparator String.CASE_INSENSITIVE_ORDER we could perform case ignored search.
🌐
javathinking
javathinking.com › blog › option-to-ignore-case-with-contains-method
Is There an Option to Ignore Case with .contains() Method in Java? Case-Insensitive DVD Title Search in ArrayList — javathinking.com
Use anyMatch() with a predicate that compares elements using String.equalsIgnoreCase(), which ignores case. public static boolean containsIgnoreCaseStream(List<String> list, String searchTerm) { if (searchTerm == null) return false; return ...
🌐
Javatpoint
javatpoint.com › containsignorecase-method-in-java
containsIgnoreCase() Method in Java - Javatpoint
containsIgnoreCase() Method in Java with java tutorial, features, history, variables, programs, operators, oops concept, array, string, map, math, methods, examples etc.
🌐
Baeldung
baeldung.com › home › java › java string › case-insensitive string matching in java
Case-Insensitive String Matching in Java | Baeldung
August 28, 2025 - In this tutorial, we looked at a few different ways to check a String for a substring, while ignoring the case in Java. We looked at using String.toLowerCase() and toUpperCase(), String.matches(), String.regionMatches(), Apache Commons StringUtils.containsIgnoreCase(), and Pattern.matcher().find().
🌐
Bukkit
bukkit.org › threads › equalsignorecase-list.354783
Solved - EqualsIgnoreCase List? | Bukkit Forums
April 12, 2015 - hai guys, so basicly all i need is my plugin to take a string, and turn it into a list of every combination of caps and lower case possible, here is an...