c# - how to substring email address -


i new c# , don't know how substrings in email address.

for example if email address is: name.surname@company.com or support@company.com want know how can separate information email address?

like name.surname@company.com

string _name = name; string _surname = surname; string _company = company; string domaine = company.com; 

or if support@company.com then

string _name = support; string _company = company; string domaine = company.com 

thank help

you can use mailaddress class this.

var mail = new mailaddress("name.surname@company.com"); var user = mail.user; // name.surname var host = mail.host; // company.com 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -