Hadi Elmougy Hadi Elmougy - 1 year ago 92
Scala Question

partition an Array with offset

in Clojure I can partition a vector with offset step like

(partition 2 1 [1 2 3 4])

this returns a sequence of lists of n items each at offsets step apart.
for example the previous method returns

((1 2) (2 3) (3 4))

I just wonder how can I acheive the same in Scala

Answer Source

I think this does what you need:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download