From: Brian Candler Date: 2011-04-25T01:01:22+09:00 Subject: Re: Can I split the array from text? Sira PS wrote in post #994712: > If I have an array like this > > ["Member", "Friends", "Hello", "Components", "Family", "Lastname"] > > And I need to split this array from "Components" and get 2 arrays which > are > > ["Member", "Friends", "Hello"] > > and > > ["Family", "Lastname"] > > Can I do that and how? I think this is the simplest way: a = ["Member", "Friends", "Hello", "Components", "Family", "Lastname"] i = a.index("Components") p a[0...i] p a[i+1..-1] -- Posted via http://www.ruby-forum.com/.