ThrowIfNotHex Method
Definition
ThrowIfNotHex(string, string, string)
Validates and throws an ArgumentException if the specified argument is not hexadecimal.
public static void ThrowIfNotHex(string argument, string message = "Value must be hexadecimal.", 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
argumentmust be hexadecimal.