On Friday, 13 April 2018 at 17:41:00 UTC, Adam D. Ruppe wrote: > 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 just `if (s.length)` is enough.