How to get array length

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 22 16:26:00 PDT 2014


On 05/22/2014 04:22 PM, kaz wrote:
> Is there a way to get the length of an array out of slice bracket in D?
>
> Tks.

If you mean the length of the original array, no. Of course, the length 
of the slice is trivial: slice.length.

The following article explains how slices don't know about other slices 
(including the original array):

   http://dlang.org/d-array-article.html

Ali



More information about the Digitalmars-d-learn mailing list