How to extract emai id?

Hello everyone,
I need to extract email id’s without domain and also want to remove any special character from id. For example
abc_xyz@gmail.com, or abc_xyz123@gmail.com
I want to extract only abcxyz or abcxyz123
hopefully I am clear in my question.

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Replace(yourString.Substring(0,yourString.IndexOf("@")),"[^A-Za-z0-9]","")

Sample20230428-3L.zip (2.2 KB)

Regards,

thank you so much, helped a lot.
Much appreciated.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.