int types are always initialized (to zero). You can check if a string type is null ( if (myString == null) { // Not initialized .

In general, a null reference means the variable doesn't have an object.

>int types are always initialized (to zero).
This misconception is why I asked for a more specific question. As an example, local variables are not automatically initialized, which means there's no way to check them without relying on compiler warnings/errors.

static void Main(string[] args)
{
    int i; // Not initialized (value type)
    string s; // Not initialized (reference type)

    // ...
}

Also, you should use the static String.IsNullOrEmpty method to check for uninitialised strings.

Also, you should use the static String.IsNullOrEmpty method to check for uninitialised strings.

but what is benefit of using static string?

I meant the static method of the String class IsNullOrEmpty , not that the string itself is static. This static method checks whether the string is unitialised or initialised to String.Empty .

Comments

I meant the static method of the String class IsNullOrEmpty , not that the string itself is static. This static method checks whether the string is unitialised or initialised to String.Empty .

hmm got it..

Comments
This question has already been answered. Start a new discussion instead.