Created
September 30, 2010 14:00
-
-
Save blais/604609 to your computer and use it in GitHub Desktop.
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
;; 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