puts (Array.new(200) {(1..100).to_a[rand(100)]}).group_by { |x| (x - 1) / 10 }.sort_by { |x| x }.map {|x, y| [10 * x + 1, "-" , 10 * (x + 1), " ", "|", " ", "*" * (y.length)]}
In the above code, I need to chomp after each comma in the map block. The issue is that I keep getting the following output no matter what I do:
1
-
10
|
*************************
How can I chomp inside the map to make it look like the following
1-10 | ********************
But if your goal is to do that, why are you creating the nested arrays in the first place?
With some cleanup, maintaining your single-line thing: