+ 1
Can someone help me with this ruby code.
It keeps on telling me that "undefined method 'upcase' for ["med", "sof"]: Array" But rather accept reverse order. arr = ["med", "sof"] test = arr.upcase print test
2 Answers
+ 8
@merkrafter has the right code, keep in mind that if you want to upper case a specific value you need to specify the array value or if you want the whole array to be upper cased then you might need to iterate through each values.
+ 2
There is no upcase method defined for arrays. Try to use it for every entry of your array like:
arr = [...]
for x in arr
x.upcase!
end
print arr