Created
May 25, 2013 09:23
-
-
Save derekchiang/5648495 to your computer and use it in GitHub Desktop.
A little function that returns the basename of a filename.
This file contains 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
baseName = (str) -> | |
base = new String(str).substring(str.lastIndexOf("/") + 1) | |
base = base.substring(0, base.lastIndexOf(".")) unless base.lastIndexOf(".") is -1 | |
return base |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment