VB.Net - How do I get string before the @ chr in an email address
-
Hi All, Can anyone help me. I have tried various methods and it doesnt seem to work. I'm trying to get string before the @ in an email address strEmail = Eddiez@gmail.nl //Something happens here strBefore = Eddievdz Messagebox.show("Hello" + strBefore) Thank you all
-
Hi All, Can anyone help me. I have tried various methods and it doesnt seem to work. I'm trying to get string before the @ in an email address strEmail = Eddiez@gmail.nl //Something happens here strBefore = Eddievdz Messagebox.show("Hello" + strBefore) Thank you all
try this:
dim strEmail as string, strBefore as string
dim pos as integerstrEmail = Eddiez@gmail.nl
pos = strEmail.IndexOf("@")
strBefore = strEmail.Substring(0,pos) -
Hi All, Can anyone help me. I have tried various methods and it doesnt seem to work. I'm trying to get string before the @ in an email address strEmail = Eddiez@gmail.nl //Something happens here strBefore = Eddievdz Messagebox.show("Hello" + strBefore) Thank you all
Hi, Try This.
dim strEmail as string, strBefore as string
strEmail = Eddiez@gmail.nl
Dim s() as string = strEmail.Split("@"c)
strBefore = s(0) -
Hi All, Can anyone help me. I have tried various methods and it doesnt seem to work. I'm trying to get string before the @ in an email address strEmail = Eddiez@gmail.nl //Something happens here strBefore = Eddievdz Messagebox.show("Hello" + strBefore) Thank you all
Thanks guys, this helped alot.Thanks a million