2
是否可以使用單個%w
指令定義多維數組?Ruby:多維%w數組?
例如:
the_array = %w(one two three{some separator}four five{some separator}six seven eight nine)
我需要這個建在一排物品的可變數量的數組:
the_array = [
['one', 'two', 'three'],
['four', 'five'],
['six', 'seven', 'eight', 'nine']
]