Question: I am wondering if there is a special method/trick to check if a `String` object is null. I know about the [`String.IsNullOrEmpty`](http://msdn.microsoft.com/en-us/library/system.string.isnullorempty.aspx) method but I want to differentiate a `null` String from an empty String (=`""`).

Should I simply use:

```
if (s == null) {
    // blah blah...
}

```

...or is there another way?

Answer: 
An *object* can't be null - the value of an *expression* can be null. It's worth making the difference clear in your mind. The value of `s` isn't an object - it's a *reference*, which is either null or refers to an object.

And yes, you should just use

```
if (s == null)

```

Note that this will still use the overloaded == operator defined in string, but that will do the right thing.
For .net 5 (probably also for .net Core 3.1)

Different possibility to write but always the same problem.

```
string wep = test ?? "replace";
Console.WriteLine(wep);

```

result: "replace"

or

```
string test=null;
test ??= "replace";
Console.WriteLine(test);
test="";
test??="replace";
Console.WriteLine(test);

```

* first try: "replace"
* second try: blank

```
string test="";
if(test is null)
    Console.WriteLine("yaouh");
else
    Console.WriteLine("Not yahouu");

```

Result: "Not yahou"