Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby array of symbols shorthand

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"]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ruby #array #symbols #shorthand
ADD COMMENT
Topic
Name
3+8 =