Condividi tramite


Throw.IfArgumentNullOrEmpty(String, String, String) Method

Definition

Throws ArgumentNullException or ArgumentException with the given parameter name and optional message if the given string is null or empty, respectively.

public static void IfArgumentNullOrEmpty (string value, string paramName, string message = default);
static member IfArgumentNullOrEmpty : string * string * string -> unit
Public Shared Sub IfArgumentNullOrEmpty (value As String, paramName As String, Optional message As String = Nothing)

Parameters

value
String

The string to test for null or empty.

paramName
String

The name of the parameter being validated. This is passed to the ArgumentNullException or ArgumentException constructor.

message
String

An optional error message to include in the ArgumentNullException or ArgumentException.

Applies to