The Simplest Solution: String. toLowerCase() . In this case, we’ll transform both strings to lowercase and then use the contains() method: assertTrue(src. toLowerCase().22 May 2021
Read moreIs set contains case sensitive?
Yes. Collection membership is case sensitive. This applies to Sets: If the set contains String elements, the elements are case-sensitive .
Read moreHow do you make a case insensitive in Java?
Java String equalsIgnoreCase() Method The equalsIgnoreCase() method compares two strings, ignoring lower case and upper case differences. This method returns true if the strings are equal, and false if not. Tip: Use the compareToIgnoreCase() method to compare two strings lexicographically, ignoring case differences.
Read more