using System.Text;
using System.Text.RegularExpressions;

        public static bool ValidateEmail(string str)
        {
            if (str == null)
            {
                return false;
            }
            else
            {
                return Regex.IsMatch(str, @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");
            }
        }
Last modified: June 8, 2021

Author

Comments

Write a Reply or Comment