Subject: Re: help directory name issue...
From: 7stud -- <bbxx789_05ss yahoo.com>
Date: Tue, 25 Aug 2009 19:59:36 +0900
References: 344808
In-reply-to: 344808
In addition, you can always use the universal hammer: split().
fname = "C:/path/to/dir/pic10.jpg"
pieces = fname.split("/")
puts pieces[-2] #dir
parts = pieces[-1].split(".")
puts parts[0] #pic10
--
Posted via http://www.ruby-forum.com/.