My question is about how to convert array elements to string in ruby 1.9 without getting the brackets and quotation marks. I\'ve got an array (DB extract), from which I want to
Use interpolation instead of concatenation:
reportStr = "In the first quarter we sold #{myArray[3]} #{myArray[0]}(s)."
It's more idiomatic, more efficient, requires less typing and automatically calls to_s for you.
to_s