How to I left or right trim data

I would like to extract a reference number from a clients Lastname and a unique number.

Eg. LAWSON 6809
I need to get : L6809

Please help.

Hi Giri

I went there and tried to copy the code. It doesn’t work. That’s why I decided to post a message. How do i enter JavaScript into wixcode? thank you.