null == "" is true?

Antonio antonio at abrevia.net
Tue Jul 12 20:38:26 UTC 2022


On Tuesday, 12 July 2022 at 20:36:03 UTC, Antonio wrote:
> Honestly, it is difficult to understand for newcomers... there 
> is a reason, but there is a reason in javascript for `0 == ''` 
> too

Correction

```d
string a = null;
assert(a is null);
assert(a == "");

string b = "";
assert(b !is null);
assert(b == null);
```



More information about the Digitalmars-d-learn mailing list