How can I split an email address in C# using asp.net mvc? -


this question has answer here:

i have example of email address "mynameismine@hotmail.com", want obtain or cut string value , obtain "mynameismine", dont want have "@hotmail.com".

if you're going manipulating email addresses you're best off using mailaddress class in system.net.mail namespace:

mailaddress addr = new mailaddress("mynameismine@hotmail.com"); string username = addr.user; string domain = addr.host; 

username part before '@' symbol , domain part after.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -