.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

String empty or not

Posted By:laptop charles       Posted Date: August 31, 2010    Points: 10    Category: Visual Studio    URL: http://www.dotnetspark.com  

whether check the string empty or not

C#.net using string concept.
check the string empty or not.
using System;
using System.Collections.Generic;
using System.Text;

namespace check_the_string_empty_or_not
    class Program
        static void Main(string[] args)
            string str1 = "Charles";
            string str2 = "";
            string str3 = null;
            bool res;

            res = String.IsNullOrEmpty(str1);
            res = String.IsNullOrEmpty(str2);
            res = String.IsNullOrEmpty(str3);


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend