Check whether a string is null, empty, or only contains the white-space characters

If you are working with the .Net framework 4.5, you can use the String.IsNullOrWhiteSpace Method to specify the string is null, empty, or consists only of white-space characters.

The following example contains the five string type variables, we pass the each variable into the IsNullOrWhiteSpace method to check whether a string is null, empty, or only contains the white-space characters. Continue reading “Check whether a string is null, empty, or only contains the white-space characters”