in reply to Substitute Question

Sounds like a potential Golf to me, but i have a few questions. by "preserve the original" i assume you mean preserve the case of the original... what if the old word was "ELEphant" and the new word is "donkey"?

as for faster ways to do it, i bet bitwise functions will come in useful here, since all capital letters are bitwise-and-equal to 64, and lowers are all bitwise-and-equal to 96.