61

Just found this precious gem in the legacy code I am maintaining! How do you check if a string is empty :-D ?

Comments
  • 1
    lol, and in c#?
  • 1
    @viking8 yes, in C# :-D
  • 21
    if(developersHead.IsNullOrEmpty()) ...
  • 1
    What was the original C# and .Net Framework version?
  • 6
    Probably ported from old vb script code.

    That construct was quite common when having data from a database that could be null.

    Null in vbscript is called "nothing" butmost example code used + "" to convert the nothing into empty string before comparison.
Add Comment