Skip to main content

string is null or empty(String.IsNullOrEmpty)

You can check for the strings in the code, There are many things which  you have to consider before you use a string.

Declare the string variable and assign it


if (String.IsNullOrEmpty(StringVariable)) 
  {       
        return "is null or empty";
  else
        return String.Format("(\"{0}\") is neither null nor empty", s);
  }



This will check if the string is null or empty and will return a boolean response.



Comments