how to check if a string is null or empty in VB .net

In VB .net how can I check a string to see if it is null or empty? I have a class object with a string property.
is this correct?

If (myObject.Str IsNot String.IsNullOrEmpty) Then
' Do something
End If
LVL 2
brgdotnetcontractorAsked:
Who is Participating?
 
Fernando SotoRetiredCommented:
This should do what you need.
If String.IsNullOrEmpty(StringToTest) Then
   Return "is null or empty"
Else
   ‘’ Process the string here
End If

Open in new window

0
 
Martin MillerCTOCommented:
Do you have access to string compare function... if YES, then a couple compares manually can confirm:
--> with "" , just 2 double quotes. and compare with (ZERO)  0 the number
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.