VB.Net program to demonstrate the Empty property of String class
'VB.NET program to demonstrate the Empty property
'of String class.
Imports System
Module Module1
Sub Main()
Dim str1 As String
Dim str2 As String = "Hello World"
If (str1 = String.Empty) Then
Console.WriteLine("String str1 is empty")
Else
Console.WriteLine("String str1 is not empty")
End If
If (str2 = String.Empty) Then
Console.WriteLine("String str2 is empty")
Else
Console.WriteLine("String str2 is not empty")
End If
End Sub
End Module
String str1 is empty
String str2 is not empty
Press any key to continue . . .
Table of Contents