Arsenic Arsenic - 11 months ago 56
Ruby Question

Ruby: Print something x amount of times

I want to return a string 'x' amount of times. My current code

return str + str + str + str

What do I do to make it look something like

return 4 * str

Answer Source

You are close...

return str * 4