[ACCEPTED]-Space in the ruby array by %w-arrays
Accepted answer
Escape it:
%w(a b\ c) # => ["a", "b c"]
0
Try this:
>> a = %w(a\ b c)
=> ["a ", "b", "c"]
0
Try this:
>> a = %W[a \s b]
=> ["a", " ", "b"]
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.