String.IsNullOrWhiteSpace Method (String)
.NET Framework (current version)
Indicates whether a specified string is null, empty, or consists only of white-space characters.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
-
Type:
System.String
The string to test.
Return Value
Type: System.Booleantrue if the value parameter is null or String.Empty, or if value consists exclusively of white-space characters.
IsNullOrWhiteSpace is a convenience method that is similar to the following code, except that it offers superior performance:
White-space characters are defined by the Unicode standard. The IsNullOrWhiteSpace method interprets any character that returns a value of true when it is passed to the Char.IsWhiteSpace method as a white-space character.
Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Windows Phone
Available since 8.1
Show: