Check string isnull or empty

Posted by Rajni.Shekhar under ASP.NET category on | Points: 40 | Views : 1768
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


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

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

Thanks and Regards
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