From: Feng Tien Date: 2007-11-16T12:40:44+09:00 Subject: Stripping the extensions off of a file... I'm building a program that goes thru a file structure, and it will find the longest filename and biggest files. Find.find(directory) do |f| file_sizes[File.size(f)]= f if File.file?(f) file_stripper = File.basename(f).delete(".jpg") #FIGURE OUT TO STRIP THE ExTENSION file_length[f] = file_stripper end end I got that part, but I can't seem to be able to strip the extension, because I don't want to count the extensions part part of the length. Can the delete method take regexep? WHat would the regexep for something like anything after the "."? thanks! -- Posted via http://www.ruby-forum.com/.