Last active
December 17, 2015 16:49
-
-
Save derekchiang/5641941 to your computer and use it in GitHub Desktop.
A simple function for getting the extension of a filename.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getExtension = (filename) -> | |
i = filename.lastIndexOf '.' | |
return if i < 0 then '' else filename.substr (i+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment