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 -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -