Forum: Ruby hyphens

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.
8aafedcf44e49905528db92dce034879?d=identicon&s=25 Huseyin Polat (hpolat)
on 2006-04-06 12:17
how can I scan a string and chop it of to a words without losing the
hyphens ?
EG: apple $ two ( to be
will be saved in the array
as array = ['apple', '$' , 'two', '(' , 'to' , 'be']
thank you
Ffcb418e17cac2873d611c2b8d8d891c?d=identicon&s=25 unknown (Guest)
on 2006-04-06 12:24
(Received via mailing list)
> how can I scan a string and chop it of to a words without losing the
> hyphens ?
> EG: apple $ two ( to be
> will be saved in the array
> as array = ['apple', '$' , 'two', '(' , 'to' , 'be']
> thank you

split?

  'apple $ two ( to be'.split
This topic is locked and can not be replied to.