Skip to content

Instantly share code, notes, and snippets.

@cemerick
Created November 3, 2010 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemerick/0af84c12661344c75114 to your computer and use it in GitHub Desktop.
Save cemerick/0af84c12661344c75114 to your computer and use it in GitHub Desktop.
(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