C# 4.0-string.IsNullOrWhiteSpace()

added by jalpesh
3/21/2010 1:09:59 PM


We have already has string.IsNullOrEmpty() method to check whether the string is null or empty.Now with Microsoft.NET Framework 4.0 there is a new another method that is that is called string.IsNullOrWhiteSpace() which will also check whether string is having whitespaces or not with null and empty string.This method is help full where we can check string is having whitespace rather then its empty or null. It will return a true if a string is empty,null or its having whitespaces. Let’s create a simple ...