Thanks for the info Lars. I didn't use that one because it doesn't work in a calculated attribute of the view (see the original question) so I had to go with the string mangling thing. If you have a way to make it work please let me know as I would rather use built-in functions like you suggested.
Cheers,
D.