rowmark rowmark - 10 months ago 70
C# Question

Left of a character in a string in C#

How do I get the left of "@" character from the emailID string "feedback@abc.com" in C#

Thanks

Answer Source
string email = "feedback@abc.comm";
int index = email.IndexOf("@");
string user = (index > 0 ? email.Substring(0, index) : "");