Skip to content

Instantly share code, notes, and snippets.

@ecarter
Created November 5, 2011 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecarter/1341628 to your computer and use it in GitHub Desktop.
Save ecarter/1341628 to your computer and use it in GitHub Desktop.
get file extension from path in coffeescript
# get file extension from path
ext = (path) ->
index = path.lastIndexOf('.')
extension = path.substr(index).replace('.', '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment