Why does trying to use string? (Nullable string) in C# produce a syntax error?

Suffix on the name of a type is an alias for using Nullable.

Suffix on the name of a type is an alias for using Nullable (section 4.1.10 of the C# 4 spec). The type parameter for Nullable has the struct constraint: public struct Nullable where T : struct This constrains T to be a non-nullable value type. That prohibits you from using string, as System.

String is a reference type. Fortunately, as string is a reference type, you don't need to use Nullable - it already has a null value (the null reference): string x = null; // No problems here.

This is a much better explanation Jon – DJ KRAZE Dec 20 at 15:34.

Expected = "BB1 1BB"; change the initial declaration to string expected = string. Empty; //for initialize if you are using . Net 4.0 take advantage of the default key word string expected = default.

The default keyword doesn't stand on its own unless in a switch/case. And the default value of strings is not string.Empty. – BoltClock?

Dec 20 at 15:36 my bad may have written my intentions incorrectly.. sometimes the hand works faster than the mind.. when typing that is.. – DJ KRAZE Dec 20 at 15:45.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions