devxlogo

Parsing String for E-Mail Address

Parsing String for E-Mail Address

Question:
I semi-understand InStr, however, lets say I am trying to parse e-mail addresses and test for “@”. How do I find my way to the beginning and end of the address?

Answer:
Let’s say that sEmail is the address of someone (for example, sEmail = “[email protected]”)

sUserID = left$(sEMail, Instr(sEMail, “@”) – 1)sHostname = right$(sEMail, len(sEMail) – Instr(sEMail, “@”))
Instr(sEMail, “@”) returns the integer 8.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist