Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: If Statement Help

$
0
0

In this case, it’s never null. If the box is empty, the Text property will return a non-null (but empty) string.

In general, you can avoid having problems with this distinction by using the String.IsNullOrEmpty method:

if ([String]::IsNullOrEmpty($someVariable)) { }

Viewing all articles
Browse latest Browse all 13067

Trending Articles