ThrowIfEmailAddress Method
Definition
ThrowIfEmailAddress(string, string, string)
Validates and throws an ArgumentException if the specified argument has the format of an email address.
public static void ThrowIfEmailAddress(string argument, string message = "Value cannot be an email address.", string paramName = null)
Parameters
argumentstringThe value to be evaluated.
messagestringA message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Exceptions
- ArgumentException
argumentcannot be an email address.