I'm making an app that searches a database - I want the search term to be bolded in my output. Suppose I have a string:
String s = "Foo Bar foobAr";
String searchTerm = "bar";
now, I want to surround every occurance of searchTerm in my string s with (to make it bold) regardless of case. Output should be:
"Foo <b>Bar</b> foo<b>bAr</b>"
This is relevant, but it makes the output the same as the searchTerm - I want to preserve the casing of the original string.