Remove @ from email in the script

Hi

I want to ask if it's possible to remove the @ from the user's email and fetch the first part of the email, so, it will go something like this: a.alshai@gmail.com it will be a.alshai, as I want to add it in a pop-up URL.

Thank you.

If it is inside the script, then check this article Additional functions to use in dynamic variables - Genesys Cloud Resource Center (mypurecloud.com)

You would probably end it up with substr({{variable}},0,indexOf({{variable}},"@"))