CS.NET - Working with string.IsNullOrWhiteSpace() in .NET4



cheat to understand string.IsNullOrWhiteSpace()

static void Main()
        {
            string strTest = "Syntax Help";
            string strNull = null;
            string strEmpty = string.Empty;
            string strWhiteSpace = "\t\r\n\n ";
            Console.WriteLine("Is null or whitespace Exmaple!!");
            Console.WriteLine("TestSting: " + string.IsNullOrWhiteSpace(strTest));//false
            Console.WriteLine("NullString: " + string.IsNullOrWhiteSpace(strNull)); //true
            Console.WriteLine("EmptyString: " + string.IsNullOrWhiteSpace(strEmpty)); //true
            Console.WriteLine("WhiteSpaceString: " + string.IsNullOrWhiteSpace(strWhiteSpace));  //true                      
            Console.ReadLine();
        } 

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.