我喜欢这个字符串数组的文字表达式:
%w( i can easily create arrays of words )
Run Code Online (Sandbox Code Playgroud)
我想知道是否有一个文字来获得一个符号数组.我知道我能做到
%w( it is less elegant to create arrays of symbols ).map( &:to_sym )
Run Code Online (Sandbox Code Playgroud)
但是使用文字就好了.