Skip to content

Instantly share code, notes, and snippets.

@musicm122
Last active August 29, 2015 14:22
Show Gist options
  • Save musicm122/6d2eb4fd5dd5d538cfaf to your computer and use it in GitHub Desktop.
Save musicm122/6d2eb4fd5dd5d538cfaf to your computer and use it in GitHub Desktop.
Clojure getFileExt
(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