There is a contains String method:
String str = "Hello"; if (str.toLowerCase().contains("he"))
There is also a startsWith method on a String :
if (str.toLowerCase().startsWith("he"))
If both lines are variables with unknown contents, and the case is not important, then:
str.toLowerCase().contains(str2.toLowerCase())) str.toLowerCase().startsWith(str2.toLowerCase()))
pb2q
source share