Before .NET 4 is out, we've been doing something like this to check for null / empty string :
String s;
if ((s + "").Trim().Length == 0)
{
//do something
}
While the above method works pretty well for us, I know that in .NET 4, we got a IsNullOrWhiteSpace
method to do the similar thing.
My question is, which one is better? Do we should switch to use the built-in function instead?