In Earlier versions of .NET, String class has IsNullOrEmpty() method, which can be used to check whether the string is null or empty. To check for white spaces, we need to write additional code. Now .NET 4.0 introduced a new method, IsNullOrWhiteSpace() in string class, which will check for white space characters also. White space characters include all characters that are not visible on screen by example space, line break, tab and empty string etc.
if(string.IsNullOrWhiteSpace(strUrl) { //do something }
Published under: Microsoft .NET Tips · · · ·
Very nice tip kirti........it is very useful..
Thank You Rami.
Useful information