Melba23,
I was all set to post some sample code which looks like something the cat threw up compared to yours. but that's done exactly what I wanted. Thanks!
I will remember to include the samples first, next time I have a question.
jchd thanks for your quick reply, silly of me not to include any source (though at the time all I had was text and a scratched head).
And czardas, it's nice code, and I didn't think of just using replace like that. A 'duh' light bulb idea, so simple yet so effective!