And*_*eis 18
小写%i代表
非插值符号数组,由空格分隔(在Ruby 2.0之后)
另外,大写%I意味着
内插的符号数组,由空格分隔(在Ruby 2.0之后)
插值差异示例:
2.4.2 :001 > a = 1
2.4.2 :002 > %i{one two #{a}+three} # Interpolation is ignored
 => [:one, :two, :"\#{a}+three"]
2.4.2 :003 > %I{one two #{a}+three} # Interpolation works
 => [:one, :two, :"1+three"]
请在此处查看更多信息.
我在查找与
%i符号数组有关的内容时遇到了麻烦。
它是符号数组的数组文字。对于符号数组,'它与对字符串的作用相同。
| 归档时间: | 
 | 
| 查看次数: | 10140 次 | 
| 最近记录: |