ThrowIfNullOrWhitespace Method
Definition
ThrowIfNullOrWhitespace(string, string, string)
Validates and throws either an ArgumentNullException or ArgumentException if the specified argument is respectively null, empty or consist only of white-space characters.
public static void ThrowIfNullOrWhitespace(string argument, string message = null, 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
- ArgumentNullException
argumentcannot be null.- ArgumentException
argumentcannot be empty or consist only of white-space characters.