Trying to figure out how to use character wrapping to mutate a string based on user input. If string is \'Bob loves to build building\' and user chooses to replace all letter B/
Your question is unclear (how 'b' becomes 'm' in Bob -> Tom?). However, to run case insensitive replace you should do something like this:
String text ="Bob loves to build building";
String b = "b";
Pattern p = Pattern.compile(b, Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(text);
String outText = m.replaceAll("T");