Since you're doing string-cleaning, you might care to take a look at using the Regex functionality. In 2000, you can tap into Regular Expressions using custom Regex Extended procedures; there are copies of those in the scripts area on here ( I think they are in the DBA toolkit for 2000 if that is still up there).
It tends to make things much clearer and cleaner (usually turning that into a single, much cleaner function call).
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?