Skip to content

Instantly share code, notes, and snippets.

@blais blais/utils.clj
Created Sep 30, 2010

Embed
What would you like to do?
;; FIXME: This is missing from the stdlib.
(defn split-extension [filename]
(let [index (.lastIndexOf filename ".")]
(list (.substring filename 0 index) (.substring filename index))))
(defn get-basename [filename]
(let [index (.lastIndexOf filename ".")]
(.substring filename 0 index)))
(defn get-extension [filename]
(let [index (.lastIndexOf filename ".")]
(.substring filename index)))
(let [s "/sdjsd/sds/djsdsj.txt"]
(map #(% s) (list get-basename get-extension split-extension)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.