Adf.Business.ValueObject.Email.TryParse C# (CSharp) Method

TryParse() public static method

Tries to parse the supplied string into the supplied Email object.
public static TryParse ( string s, Email &result ) : bool
s string The string to parse.
result Email The object.
return bool
        public static bool TryParse(string s, out Email result )
        {
            if (string.IsNullOrEmpty(s))
            {
                result = Empty;
                return true;
            }

            if (!Expression.IsMatch(s))
            {
                result = Empty;
                return false;
            }

            result = new Email(s);
            return true;
        }

Same methods

Email::TryParse ( string s, IFormatProvider provider, Email &result ) : bool