S
S Kanakakorn
Hi,
I'm quite new in Ruby. Here is what I wrote to convert array of
integer to array of string. I'm sure there is more compact and nicer
way to do this. Can I see the "ruby" way here ?
def convert(intArray)
stringArray = []
intArray.each do |i|
stringArray = stringArray + i.to_s.to_a
end
return stringArray
end
Thanks,
I'm quite new in Ruby. Here is what I wrote to convert array of
integer to array of string. I'm sure there is more compact and nicer
way to do this. Can I see the "ruby" way here ?
def convert(intArray)
stringArray = []
intArray.each do |i|
stringArray = stringArray + i.to_s.to_a
end
return stringArray
end
Thanks,