How to check if a string is null or empty in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim str As String = Nothing

        If String.IsNullOrEmpty(str) = True Then
            Console.WriteLine("Null Or Empty")
        Else
            Console.WriteLine("Not Null Or Empty")
        End If
    End Sub
End Class


' run:
'
' Null Or Empty
'

 



answered Nov 5, 2024 by avibootz
...