Arsenic Arsenic - 1 year ago 83
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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download