rowmark rowmark - 1 month ago 9
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
string email = "feedback@abc.comm";
int index = email.IndexOf("@");
string user = (index > 0 ? email.Substring(0, index) : "");