ruby %i %w code example
Example 1: ruby %w meaning
%w(foo bar) is a shortcut for ["foo", "bar"]. Creates an array of the strings.
Example 2: %w meaning in ruby
This is basically a way of converting text into an arary of strings!!
%w(foo bar) is a shortcut for ["foo", "bar"]. Creates an array of the strings.
This is basically a way of converting text into an arary of strings!!