isnullorempty

Can I safely ignore CodeAnalysis warning: replace string == "" with string.IsNullOrEmpty ?

I've got code similar to this: string s = CreateString(); if (s == "") foo(s); If s equals "", foo should be called. If string is null, which should never happen, then a NullReferenceException is fine (as this is, after all, an exceptional situation). CodeAnalysis tells me to test for s.IsNullOrEmpty. This would alter the functionali...

C# String.IsNullOrEmpty: good or bad?

After an incident at work where I misused String.IsNullOrEmpty with a Session variable, a fellow coworker of mine now refuses to accept my usage of String.IsNullOrEmpty. After some research, apparently there's a bug listed for IsNullOrEmpty on MSDN (link) (read note at the bottom): As of April 4, 2006, there is a bug (possible in ...

sqlite select where empty?

Select in sqlite where some_colum is empty. empty counts as both NULL and "". ...