On Tue, 03 Mar 2009 02:03:23 +0300, BCS <a...@pathlink.com> wrote:

Reply to Qian,

Hi,
 I am confusing with getting sub-string of a char[].

[..]
 My question is: why s[4]=E, but s[0..4]=ABCD (without E)


Having the fist number be included and the second not works better than the other options.

Consider what would have to change to make these work for the the other options:

arr[0 .. n] and arr[n .. arr.length] cover the full array

arr[0 .. 0] is empty

arr[0 .. arr.length] is the full array



That and also

assert(arr[a..b].length == (b - a)); // evaluates to true always

Reply via email to