Forum: Ruby empty element in string array?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
896cfc242a7762467c2a0b2af86598e5?d=identicon&s=25 Simon Strandgaard (Guest)
on 2006-03-06 17:45
(Received via mailing list)
%w(a \  b)     #-> ["a", " ", "b"]


is it possible to get output ["a", "", "b"]  ?
896cfc242a7762467c2a0b2af86598e5?d=identicon&s=25 Simon Strandgaard (Guest)
on 2006-03-06 17:45
(Received via mailing list)
On 3/6/06, Simon Strandgaard <neoneye@gmail.com> wrote:
> %w(a \  b)     #-> ["a", " ", "b"]
>
>
> is it possible to get output ["a", "", "b"]  ?
>

argh.. nevermind

%W(a #{} b)  #=> ["a", "", "b"]
This topic is locked and can not be replied to.