From: Thomas Sawyer Date: 2008-07-27T06:44:57+09:00 Subject: Re: head/tail split for path Hi David, David A. Black wrote: > > Check out the Pathname feature: > > require 'pathname' > > p = Pathname.new("a/b/c") > > You get p.basename and p.dirname. Both return Pathname objects, but > they're quite string-like and easily converted. p = Pathname.new("a/b/c") p.dirname #=> "a/b" p.basename #=> "c" But I need "a" and "b/c". T. -- Posted via http://www.ruby-forum.com/.