Skip to content

Instantly share code, notes, and snippets.

@cemerick cemerick/funky_munge.clj Secret
Created Nov 3, 2010

Embed
What would you like to do?
(defn funky-munge
[s]
(->> s
(partition-by #{\_ \-})
(mapcat #(cons (Character/toUpperCase ^Character (first %)) (rest %)))
(apply str)))
(defn funky-regex-munge
[s]
(->> s
(re-seq #"[^\-_]+|[\-_]+")
(mapcat #(cons (Character/toUpperCase ^Character (first %)) (rest %)))
(apply str)))
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.