String target = "FOOBar"; target = target.replaceAll("(?i)foo", ""); System.out.println(target);
String phrase = "StEVen"; String result = phrase.replaceAll("(?i)e", "f"); System.out.println(result);