Delen via


Requires.NotNullOrWhiteSpace(String, String) Method

Definition

Throws an exception if the specified parameter's value is null, empty, or whitespace.

public:
 static void NotNullOrWhiteSpace(System::String ^ value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrWhiteSpace (string value, string? parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrWhiteSpace (string value, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
static member NotNullOrWhiteSpace : string * string -> unit
Public Shared Sub NotNullOrWhiteSpace (value As String, parameterName As String)
Public Shared Sub NotNullOrWhiteSpace (value As String, Optional parameterName As String = Nothing)

Parameters

value
String

The value of the argument.

parameterName
String

The name of the parameter to include in any thrown exception. If this argument is omitted (explicitly writing null does not qualify), the expression used in the first argument will be used as the parameter name.

Attributes

Exceptions

Thrown if value is null or empty.

Applies to