Last active
August 29, 2015 14:22
-
-
Save musicm122/6d2eb4fd5dd5d538cfaf to your computer and use it in GitHub Desktop.
Clojure getFileExt
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
(defn getFileExt | |
[& *args*] (apply getFileExt *args* ) | |
[arg] (str (subs arg (.lastIndexOf arg "." ))) | |
;;This works | |
;;(getFileExt "hello.txt") | |
;;this gives me invalid number of args | |
;;(getFileExt ["hello.txt" "test.end"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment