No
Try this
\\\
Dim s As String
If s Is Nothing Then MessageBox.Show("IsNothing")
If s = Nothing Then MessageBox.Show("=Nothing")
s = ""
If s Is Nothing Then MessageBox.Show("IsNothing2")
'Isnothing 2 Will not be showed
If s = Nothing Then MessageBox.Show("=Nothing2")
'=Nothing is true
//
I hope this helps?
Because if s is not nothing, then a string comparison is done to check if it
is equal to "" wich is slower than checking the length.
If s = Nothing Then
is the same as
If s is Nothing orelse s = "" Then
where as if you use
If s is Nothing orelse s.Length=0 Then
you cut out the s = "" string comparison.
The performance advantage is really small though and will unlikley make any
difference in a real world application (on my machine it averages out about
1/50 sec for 200000 iterations).
In addition to the other replies -- you can query old messages of this
group using Google Groups Search (<http://www.deja.com>). Just select
this group (microsoft.public.dotnet.languages.vb) in the advanced groups
search and "feed" Google with the keywords. I remember there were some
threads about this topic in the past.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.