toLowerCase() One of the easiest ways to check if a String has a substring without considering the case is to convert all the Strings to lowercase and then check for a substring . To check for a substring, we use the contains() method, and for converting the String to lowercase, we use the toLowerCase() method.