On Friday, 13 April 2018 at 17:38:39 UTC, Dr.No wrote:
string s = null; if(s !is null && s[0] == '/')is this correct?
No, that doesn't work if the string = "a"[$..$] for example Just use if(s.length && s[0]) instead
Adam D. Ruppe via Digitalmars-d-learn Fri, 13 Apr 2018 10:45:39 -0700
On Friday, 13 April 2018 at 17:38:39 UTC, Dr.No wrote:
string s = null; if(s !is null && s[0] == '/')is this correct?
No, that doesn't work if the string = "a"[$..$] for example Just use if(s.length && s[0]) instead