Suggestion: array slice through arr[base, size]

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 8 07:28:09 PST 2015


On Sunday, 8 February 2015 at 15:20:17 UTC, karl wrote:
> Hi, it's a bit unwieldy to write/read this:
> result = src[base .. base+size];
> instead of:
> result = src[base, size];

If you don't want to write "base" twice, you can write:

result = src[base..$][0..size];


More information about the Digitalmars-d mailing list