It seems kind of odd to rewrite a function that is already in the RTL, unless it is specifically being written to be faster than the RTL version. StringReplace has already been rewritten to be a lot faster as part of the FastCode project.
http://dennishomepage.gugs-cats.dk/A...eChallenge.htm