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.
Re: Parameter is null by default. No value is given. Code says it is not null.
Adam D. Ruppe via Digitalmars-d-learn Thu, 09 Apr 2015 06:36:37 -0700
Don't use string == null, it is true for empty strings since null
and an empty string are almost interchangable.
- Parameter is null by default.... tcak via Digitalmars-d-learn
- Re: Parameter is null by... tcak via Digitalmars-d-learn
- Re: Parameter is null by... Daniel Kozák via Digitalmars-d-learn
- Re: Parameter is null by... tcak via Digitalmars-d-learn
- Re: Parameter is null by... Adam D. Ruppe via Digitalmars-d-learn
- Re: Parameter is nul... tcak via Digitalmars-d-learn
- Re: Parameter is... tcak via Digitalmars-d-learn
- Re: Paramete... Daniel Kozak via Digitalmars-d-learn
- Re: Par... Daniel Kozak via Digitalmars-d-learn
- Re: Parameter is nul... Steven Schveighoffer via Digitalmars-d-learn
- Re: Parameter is... Daniel Kozák via Digitalmars-d-learn
- Re: Parameter is... Daniel Kozák via Digitalmars-d-learn