My goal is to replace a certain substring within a string that doesn't alter those that aren't strictly that substring. It is slightly confusing to write down so let me show you with an example.
Say I have the string
"StackOverflow Stack Overflow Stacks"
Now I would like to replace "Stack", if I am to use
x.replaceAll("Stack", "")
I will get
"Overflow Overflow s"
which is not desired, instead I would like the following:
"StackOverflow Overflow Stacks"