How to set and use variable equals to Nothing in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim s As String = Nothing

        If s Is Nothing Then
            Console.WriteLine("s Is Nothing")
        End If

        If IsNothing(s) Then
            Console.WriteLine("IsNothing(s)")
        End If

    End Sub

End Module

' run:
' 
' s Is Nothing
' IsNothing(s)

 



answered Sep 22, 2018 by avibootz

Related questions

1 answer 87 views
1 answer 201 views
1 answer 178 views
1 answer 137 views
1 answer 120 views
...