Thursday, June 4, 2009

string.IsNullOrEmpty Method in C#

http://dotnetperls.com/Content/IsNullOrEmpty-Samples.aspx
http://www.dotnetspider.com/resources/4540-Checking-Null-Or-Empty.aspx

How to check for null or empty string:

string str = "some value";
if(string.IsNullOrEmpty(str))
{
//do something
}

No comments: