How to clean text with Logic Hook formula?

Hello!

Im newbie in Logic Hooks.

I want to write a Logic Hook int the Account module that clean inserted text data after saving.

In Excel I used the :

TRIM, CLEAN and PROPER functions like this:

=PROPER(TRIM(CLEAN(Text)))

The formula is removed the extra spaces and other fancy charaters, and converted the text (or name) to lowercase but the firs letter to uppercase.

How to achieve this functionality with formulas provided by Sugar. Are the formulas we can use in Logic Hook is equal with formulas we can use in Sugar Logic? If yes, than how to get this functionality?

Thanks for help!

Regards,

Arpad