Umesh Kumar Umesh Kumar - 1 year ago 222
Ruby Question

Remove brackets around an array in ruby

Lets say I have an array

array = ["Hii", "Hello", "Bye"]

I want to show the array in following format


What would be the best way to do it?

Answer Source
▶ a = ["Hii","Hello","Bye"]
#⇒ ["Hii", "Hello", "Bye"]
▶ puts a.inspect[1...-1]
#⇒ "Hii", "Hello", "Bye"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download