DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Return The Extension From A File Name
// Return the extension from a file name
/(.*\.)(.*$)/.match(File.basename(file_name))[2]






Comments
Snippets Manager replied on Fri, 2009/02/27 - 4:07pm
Snippets Manager replied on Mon, 2012/05/07 - 2:27pm
File.extname(file_name)