Sadly, I had to look up the syntax for replace and I'm assuming that you mean using the print function when you refer to messages?  Or are you talking about raiseerror.