Say I have two strings,
String s1 = \"AbBaCca\"; String s2 = \"bac\";
I want to perform a check returning that s2 is contained
s2
A simpler way of doing this (without worrying about pattern matching) would be converting both Strings to lowercase:
String
String foobar = "fooBar"; String bar = "FOO"; if (foobar.toLowerCase().contains(bar.toLowerCase()) { System.out.println("It's a match!"); }