Re: Adjacent item in a array

2018-02-11 Thread Vino via Digitalmars-d-learn
On Saturday, 3 February 2018 at 22:58:04 UTC, Vino wrote: On Saturday, 3 February 2018 at 19:28:01 UTC, Seb wrote: On Saturday, 3 February 2018 at 19:13:05 UTC, Vino wrote: [...] 2.079 [1, 2] will ship with slide: --- auto arr = ["T1", "T2", "T3", "T4", "T5"]; arr.slide(2).each!writeln; ---

Re: Adjacent item in a array

2018-02-03 Thread Vino via Digitalmars-d-learn
On Saturday, 3 February 2018 at 19:28:01 UTC, Seb wrote: On Saturday, 3 February 2018 at 19:13:05 UTC, Vino wrote: [...] 2.079 [1, 2] will ship with slide: --- auto arr = ["T1", "T2", "T3", "T4", "T5"]; arr.slide(2).each!writeln; --- [...] Hi Seb; Thank you very much. From, Vino.B

Re: Adjacent item in a array

2018-02-03 Thread Seb via Digitalmars-d-learn
On Saturday, 3 February 2018 at 19:13:05 UTC, Vino wrote: Hi All, Request you help on printing an array in below, Eg: Array ("T1", "T2", "T3", "T4", "T5") Output required as below T1,T2 T2,T3 T3,T4 T4,T5 From, Vino.B 2.079 [1, 2] will ship with slide: --- auto arr = ["T1", "T2", "T3",

Re: Adjacent item in a array

2018-02-03 Thread Vino via Digitalmars-d-learn
On Saturday, 3 February 2018 at 19:19:00 UTC, Adam D. Ruppe wrote: On Saturday, 3 February 2018 at 19:13:05 UTC, Vino wrote: Request you help on printing an array in below, Try looping through the array printing the current item followed by the item after the current item. Foreach with

Re: Adjacent item in a array

2018-02-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 3 February 2018 at 19:13:05 UTC, Vino wrote: Request you help on printing an array in below, Try looping through the array printing the current item followed by the item after the current item. Foreach with index may be helpful. Consider what happens on the last element.

Adjacent item in a array

2018-02-03 Thread Vino via Digitalmars-d-learn
Hi All, Request you help on printing an array in below, Eg: Array ("T1", "T2", "T3", "T4", "T5") Output required as below T1,T2 T2,T3 T3,T4 T4,T5 From, Vino.B