There are many ways, the problem will be for you to work it out for any set of strings.
E.g:
"book".replace("oo","ooxxxok");
or use substring to cut
string bo="book".substring(0,2); string ok="book".substring(2,2)
then add together
string s = bo.concat("xxxx").concat(ok);