From: Ahmet Kilic Date: 2009-08-25T23:01:53+09:00 Subject: Re: help directory name issue... 7stud -- wrote: > 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 thank you very very much. That was what I want. > and if you want sentences you could possibly split on punctuation > instead of newlines. Yeah, I want that. I want to output some sentences, they are sql sentences insert, update. delete and table column names. Thanks I will try it. -- Posted via http://www.ruby-forum.com/.