rowmark rowmark - 1 year ago 133
C# Question

Left of a character in a string in C#

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


Answer Source
string email = "feedback@abc.comm";
int index = email.IndexOf("@");
string user = (index > 0 ? email.Substring(0, index) : "");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download