On Wed, Sep 16, 2009 at 9:20 AM, John W Higgins <wishdev / gmail.com> wrote:

> Good Morning,
>
> On Wed, Sep 16, 2009 at 9:01 AM, Re BR <rereis / hotmail.com> wrote:
>
> > Hello all,
> >
> > I have a string "apple-orange-grape". I need to create a array that will
> > look like
> > ["apple-orange-grape","orange-grape","grape"]
> >
> >
> x = "apple-orange-grape"
> tmp = x.split('-')
> (0..tmp.length-1).map{ |i| e[i..-1].join('-') }
>

Sorry that should be

(0..tmp.length-1).map{ |i| tmp[i..-1].join('-') }

John