Check string isnull or empty

Rajni.Shekhar
Posted by Rajni.Shekhar under ASP.NET category on | Points: 40 | Views : 2873
string.IsNullOrEmpty(strObject); returns true or false.

Comments or Responses

Posted by: Sheonarayan on: 3/26/2012 Level:HonoraryPlatinum | Status: [Administrator] | Points: 10
In case you want to check for the null, empty and white space too, there is another method called IsNullOrWhiteSpace

string.IsNullOrWhiteSpace(strng)


If either of the null, empty or white space is there in the strng variable, it returns true.

Thanks
Posted by: Akiii on: 3/26/2012 Level:Bronze | Status: [Member] | Points: 10
Both are very useful !


Thanks and Regards
Akiii
Posted by: Rajni.Shekhar on: 3/27/2012 Level:Bronze | Status: [Member] | Points: 10
thanks Sheonarayan for sharing another method of string.

Login to post response