SyntaxFix
Write A Post
Hire A Developer
Questions
In case the extension is not known (it needs the / separator):
irb(main):024:0> f = 'C:\foobar\blah.txt'.gsub("\\","/") => "C:/foobar/blah.txt" irb(main):027:0> File.basename(f,File.extname(f)) => "blah"