System.String.IsNullOrEmpty Method

Indicates whether the specified string is null or an string.Empty string.

Syntax

public static bool IsNullOrEmpty (string value)

Parameters

value
The string to test.

Returns

true if the value parameter is null or an empty string (""); otherwise, false.

Remarks

string.IsNullOrEmpty(string) is a convenience method that enables you to simultaneously test whether a string is null or its value is string.Empty. It is equivalent to the following code:

code reference: System.String.IsNullOrEmpty#1

You can use the string.IsNullOrWhiteSpace(string) method to test whether a string is null, its value is string.Empty, or it consists only of white-space characters.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0