funny behavior of ".."

2014-08-08 Thread seany via Digitalmars-d-learn
The .., range operator, when used like this : string a = "abcd"; string b = a[0 .. a.count()-1]; sets b to "abc". is this the expected behavior?

Re: funny behavior of ".."

2014-08-08 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Friday, 8 August 2014 at 15:17:25 UTC, seany wrote: The .., range operator, when used like this : string a = "abcd"; string b = a[0 .. a.count()-1]; sets b to "abc". is this the expected behavior? Yes. [..] is exclusive the last element. So [0..1] is a single element [0] That allows to avo