XTab's Blog

Ged Mead's Blog at vbCity

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

AprMay 2013Jun
SMTWTFS
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Archives

Topics

Ramblings

VB.NET

String.IsNullOrEmpty should not be used in production code, as it currently has a bug.

http://msmvps.com/blogs/bill/archive/2006/04/04/89234.aspx

Also, IsNullOrEmpty is redundant in VB. You get the same results if you just compare a string with an empty string.

Dim s1, s2 As String ' Default value is empty string
s1 = Nothing ' Explicitly set to Nothing
s2 = "" ' Explicitly set to an empty string
Console.WriteLine(s1 = "") 'true
Console.WriteLine(s2 = "") 'true
Console.WriteLine(s1 Is Nothing) 'true
Console.WriteLine(s2 Is Nothing) 'false
Console.ReadLine()

posted on Thursday, April 06, 2006 9:56 AM