how do i print some elements of an array in a new line in ruby?

Formatting an array can be done with the [%] method1

arr.each_slice(3){|trio| puts "%s: %d, %d" % trio}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top