Friends, In this small post, I will show you how we can validate a string as proper email or not using Regex class in C#. Below is the code – public bool ValidateEmail(string emailAddress) { string regexPattern = @”^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$”; Match matches=Regex.Match(emailAddress,regexPattern); return matches.Success; } The above function takes a string parameter and returns if the…
Continue Reading »