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
How do you make a method case-insensitive in Java?
The Simplest Solution: String. toLowerCase() . In this case, we’ll transform both strings to lowercase and then use the contains() method: assertTrue(src. toLowerCase().