Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 38 and Version 39 of ArrayArticle

Show
Ignore:
Author:
schveiguy (IP: 72.70.59.98)
Timestamp:
05/31/11 13:54:09 (6 years ago)
Comment:

Made note about upper limits in slicing.

Legend:

Unmodified
Added
Removed
Modified
  • ArrayArticle

    v38 v39  
    4242 
    4343    int[] b = a[0..2];   // This is a 'slicing' operation.  b now refers to the 
    44                          // first two elements of a 
     44                         // first two elements of a.  Note that D uses open interval 
     45                         // for the upper limit, so a[2] is not included in b. 
    4546 
    4647    int[] c = a[$-2..$]; // c refers to the last two elements of a ($ stands for