How to remove particular part from email id?

How to remove particular part from email id?


lets take for this example this is my email id…

and i want to delete this selected part i.e; @gmail.com

currently i am using this logic , i know its wrong but i am not able to find any solution for this:
image
its only removing “@” from email id…
please someone tell me how to implement this?

1 Like

Hi @NervousTuber

You can use regex expression for the above mentioned detail

System.Text.Regex.RegexExpression.Match(row.item(“FE”).ToString,"[A-Za-z\W0-9]+(?=[@])").Value.Trim

Try this

image

am i doing right? n what is regex?

Could you send the error snapshot?

Sorry , some typo mistake

use the below

System.Text.RegularExpression.Regex.Match(row.item(“FE”).ToString,"[A-Za-z\W0-9]+(?=[@])").Value.Trim

image

same error

System.Text.RegularExpressions.Regex.Match(row.item(“FE”).ToString,"[A-Za-z\W0-9]+(?=[@])").Value.Trim

Try this

1 Like

Thanks its working :slight_smile:

1 Like

What is Regex?

Answer is

A regular expression is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for “find” or “find and replace” operations on strings, or for input validation. It is a technique developed in theoretical computer science and formal language theory.

2 Likes

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