A comment on this post about the annoyance of having to test a string against null and also check it's length in situations where an "empty string" can be either has a clever solution:
if ((string.Empty + firstName).length > 0)
{
// Do something with firstName
}
Thanks Richard
This entry was posted
on Wednesday, March 9th, 2005 at 10:56 pm.