如何将元素数组转换为大写?预期输出为:
["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
=> ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"]
以下内容不起作用,并将它们保留为小写。
Day.weekday.map(&:name).each {|the_day| the_day.upcase }
=> ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]