'Awesome Print' on the same line

358 Views Asked by At

Is it possible using awesome_print to print on the same line?

For example, consider the following loop:

(0..5).each do |i|
  ap i
end

Each instance of i appears on a new line, but I would like to have the result as 012345, on the same line.

Failing this, what other ruby print methods could achieve this?

1

There are 1 best solutions below

1
MDrewT On
(0..5).each do |i|
  print i #prints on the same line
end
print "\n" #when you're done, insert a line break for neatness