Re: Can I split the array from text?
- From: Joey Zhou <yimutang@xxxxxxxxx>
- Date: Sun, 24 Apr 2011 08:35:34 -0500
Here's a tricky one:)
a = ["Member","Friends","Hello","Components","Family","Lastname"]
b = a.partition {|elem| true unless elem=="Components"..false }
p b
#=> [["Member","Friends","Hello"], ["Components","Family",
"Lastname"]]
--
Posted via http://www.ruby-forum.com/.
.
- Follow-Ups:
- Re: Can I split the array from text?
- From: Roger Braun
- Re: Can I split the array from text?
- References:
- Can I split the array from text?
- From: Sira PS
- Can I split the array from text?
- Prev by Date: Re: Does String#encode in Ruby 1.9.2 have option :fallback?
- Next by Date: Re: Can I split the array from text?
- Previous by thread: Re: Can I split the array from text?
- Next by thread: Re: Can I split the array from text?
- Index(es):