digitalmars.D.learn - Array Slicing
- DMon (21/21) Sep 27 2020 Are these in the Specification or Phobos? I figured them out a
- H. S. Teoh (5/6) Sep 27 2020 See: https://dlang.org/articles/d-array-article.html
- DMon (3/8) Sep 29 2020 Or in Articles?
Are these in the Specification or Phobos? I figured them out a
few days ago. These are from my snippet journal on arrays and
there may be more.
void main()
{
int[5] a = [1, 2, 3, 4, 5];
int[5][3] b = [[6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16,
17, 18, 19, 20]];
int[5] c;
// This:
writeln(a[1..4][0]);
writeln(b[0][1..4]);
writeln(b[1][1..4][2]);
// writeln(b[0..1][1..3]); // Range violation.
// writeln(a[$-2..$-3]); // NG.
writeln(a[$-3..$-2])
// And, this:
c[0..5] = a[0..$-0]
writeln(c);
}
My apologizes, if any if these are noted or wrong.
Sep 27 2020
On Sun, Sep 27, 2020 at 01:59:07PM +0000, DMon via Digitalmars-d-learn wrote:Are these in the Specification or Phobos?See: https://dlang.org/articles/d-array-article.html T -- Государство делает вид, что платит нам зарплату, а мы делаем вид, что работаем.
Sep 27 2020
On Sunday, 27 September 2020 at 14:25:34 UTC, H. S. Teoh wrote:On Sun, Sep 27, 2020 at 01:59:07PM +0000, DMon via Digitalmars-d-learn wrote:Or in Articles? Thanks, Teoh.Are these in the Specification or Phobos?See: https://dlang.org/articles/d-array-article.html T
Sep 29 2020








DMon <fellow.dmon gmail.com>