the official support was on the right track but did not work for me. Im using vb, but I needed to do an additional find / replace to make it work from the database, my userfunction is as follows:
Another hot tip, if you haven't discovered user functions, have a look at the link in the telerik admin post, they are way easy, and you can access them through the expression editor once you have built the project.
HTH