Parameter is null by default. No value is given. Code says it is not null.

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 9 06:32:36 PDT 2015


Don't use string == null, it is true for empty strings since null 
and an empty string are almost interchangable.

You can try if(string is null) - is instead of ==. Though usually 
in D, I just if(string.length == 0) and treat empty and null the 
same way.


More information about the Digitalmars-d-learn mailing list