I want to trim an email to get the username only. In other words for example I have :
admin@example.com
I want to trim this string to get admin only that is trim everything after the @ sign using mvc 5 or C# how could that happen?
I want to trim an email to get the username only. In other words for example I have :
admin@example.com
I want to trim this string to get admin only that is trim everything after the @ sign using mvc 5 or C# how could that happen?
string test = admin@example.com
string[] arr = test.Split('@');
string userNAme = arr[0];
Here next time use google ...
You can see this examples and this documentation.