Home » Archive

Articles tagged with: empty strings

Dot Net »

It is one of the common mistake that people compare a string with “” or String.Empty in VB.Net or C# to find its empty. Here are few examples.
// C# Wrong Ways

if ( s == “” )
if ( s == string.Empty )
if ( s.Equals(””) )
if ( s.Equals ( String.Empty)
if ( string.Equals(s,””)
if ( string.Equals ( [...]